Kay*_*Kay 2 unix linux bash shell awk
我想将列分成不同的行.例如,
test.dat
1
4
3
4
6
2
4
6
8
Run Code Online (Sandbox Code Playgroud)
我想要的是将其分解为3 x 3矩阵
out.dat
1 4 4
4 6 6
3 2 8
Run Code Online (Sandbox Code Playgroud)
尝试使用:
pr -ts" " --columns 3 file_name
Run Code Online (Sandbox Code Playgroud)
如果你不想使用它是好的和短的awk.
还有其他方法(我告诉过你,我也是从那里学到的):