I have this text file :
z1 x2 c3 v4 b5 n6 m7 a8
and i want to reformat it to:
z1
x2
c3
v4
b5
n6
m7
a8
in the Linux Terminal .
How can I do this?
I have this text file :
z1 x2 c3 v4 b5 n6 m7 a8
and i want to reformat it to:
z1
x2
c3
v4
b5
n6
m7
a8
in the Linux Terminal .
How can I do this?
2
Answers
Replace spaces with newlines using sed
You can find the syntax of
sed
on the manual page, but essentially you put the character string you want to replace between the first pair of/
, and the string to replace it with between the second one.You also don’t nessesarily need to use
/
as the delimiter, it could be any other character.To replace all whitespace with newlines, try