transpose row to column?
Hello,
I'm using Linux bash and trying to do the following: I have a file with numerous numbers listed as a row, i.e.: 0.306885 -3.12756 -0.35022 -1.15112 -0.845154 -1.85443 -5.12708 5.23309 and I want to transpose them to a column, i.e.: 0.306885 -3.12756 -0.35022 -1.15112 -0.845154 -1.85443 -5.12708 5.23309 Anyone know the best way to do this? Thanks! |
Assuming the file has just the one line, and nothing extra, then quick 'n dirty:
Code:
for x in $(cat inputfile.txt); do |
Or even more simple:
Code:
tr ' ' '\n' < file |
Simple yet elegant, thank you both!
|
All times are GMT -5. The time now is 08:33 AM. |