May 24, 2005 #1 Mag0007 MIS Feb 15, 2005 829 US How do I get a return in sed? trying replacing a space with carraige return echo "hello mr" | sed -e 's/ /\n' \n does not work.
How do I get a return in sed? trying replacing a space with carraige return echo "hello mr" | sed -e 's/ /\n' \n does not work.
May 24, 2005 #2 p5wizard IS-IT--Management Apr 18, 2005 3,165 BE first note: \n is a newline, not a carriage return... is sed a requirement? otherwise Code: tr ' ' '\n' or if your sed supports the following: Code: sed 's/ /\ /' try googling for "sed newline" HTH, p5wizard Upvote 0 Downvote
first note: \n is a newline, not a carriage return... is sed a requirement? otherwise Code: tr ' ' '\n' or if your sed supports the following: Code: sed 's/ /\ /' try googling for "sed newline" HTH, p5wizard
May 24, 2005 Thread starter #3 Mag0007 MIS Feb 15, 2005 829 US p5wizard: thanks! no, sed is not required. However your sed code does not work, I get a parse error. And yes, I have been googling around, and found notihng. If possible I can even use a perl one liner. Upvote 0 Downvote
p5wizard: thanks! no, sed is not required. However your sed code does not work, I get a parse error. And yes, I have been googling around, and found notihng. If possible I can even use a perl one liner.
May 24, 2005 #4 p5wizard IS-IT--Management Apr 18, 2005 3,165 BE google for sed newline faq it should provide plenty of sed help HTH, p5wizard Upvote 0 Downvote
May 24, 2005 #5 Chacalinc Vendor Sep 2, 2003 2,043 US add an / at the end: echo "hello mr" | sed -e 's/ /\n[red]/[/red]' Cheers. Upvote 0 Downvote
May 24, 2005 #6 PHV MIS Nov 8, 2002 53,708 FR something like this ? echo "hello mr" | tr -s ' ' '\n' Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
something like this ? echo "hello mr" | tr -s ' ' '\n' Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886