I want to break a column into different rows. e.g.,
test.dat
1
4
3
4
6
2
4
6
8
What I want is to break it into a 3 x 3 matrix
out.dat
1 4 4
4 6 6
3 2 8
Try using:
pr -ts" " --columns 3 file_name
It is good and short if you don't want to use awk
.
There are other methods too (one I told you, I also learnt it from there):
Convert text file into columns
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With