Hi
I have 5 columns like this
a b c d e
f g h i j
k l m n o
From 2nd column till the 5th column of every record, I would like to transpose them as rows, so my output file contains only one row
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
Thanks
Hi
I have 5 columns like this
a b c d e
f g h i j
k l m n o
From 2nd column till the 5th column of every record, I would like to transpose them as rows, so my output file contains only one row
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
Thanks
I tried this
echo "a b c d e
f g h i j
k l m n o" | tr ' ' '\n'
gave me the expected results
Thanks Pikk45, but my input file has more than 2000 columns.
So? tr doesn't care. It just deals char by char, so it can handle rows and columns of any size.
Is this taking too much to print??
try sed -e 's/\s/\n/g' file
That's ironic, since sed may have problems with huge lines, but tr never will!
Thanks for the information
Thanks to all of you. I used cat and then used the tr command from Pikk. It worked.
Useless cat you could have used directly
tr ' ' '\n' < file
Another approach learned from Scrutinizer:
xargs -n1 < file