Input:
--------------------------
123asd 456sdasda 789a
-------------------------
output wanted:
---------------------
123asd
456sdasda
789a
----------------------
I want this by sed in simple way
please help (I know by: tr ' ' '\n' < inputfile )I want it by sed only
rdcwayx
2
sed 's/ /\n/g' infile
xargs -n1 < infile
file contain:
This is the best site I have never come across. The best one indeed.
Very best site to post queries.
SED NOT WORKING : sed 's/ /\n/g' file1
ThisnisnthenbestnsitenInhavenneverncomenacross.nThenbestnonenindeed.
Verynbestnsitentonpostnqueries.
other one works but I want in sed only.
frans
5
In a terminal the second line will be prompted with '>'
$ echo "123asd 456sdasda 789a" | sed 's/ /\
/g'
Result
123asd
456sdasda
789a
Alrady showed by rdcwayx, but his post didn't appezr while writing mine :o
alister
6
To my knowledge, the \n escape sequence in replacement text is a gnu extension to the posix sed standard.