I have file
head file1
12 0
9 3
12 0
12 0
12 0
12 0
7 5
I want to convert the second column into row
head desired
12
0
9
3
12
0
12
0
12
0
7
5
Thanks
I have file
head file1
12 0
9 3
12 0
12 0
12 0
12 0
7 5
I want to convert the second column into row
head desired
12
0
9
3
12
0
12
0
12
0
7
5
Thanks
You can use awk
on this.
awk '{for(i=1;i<=NF;i++) printf "%s\n",$i}' input.txt
tr -s '[:blank:]' '\n' < file
or
awk 'BEGIN{RS="[ \t\n]+"} 1' file
Using xargs:
xargs -n1 < <(head input)
Or you could take advantage of the shells word splitting:
printf '%s\n' $(head input)