Unix Shell - Sed with new line

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > August 2007 > Sed with new line





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Sed with new line
Bo Yang

2007-08-27, 7:23 am

Hi,
I want to use sed -e 's/,/\n/g' file to replace all "," to new line.
But I failed. Could anyone give me some advice?

Thanks!
Bo
pgas

2007-08-27, 7:23 am

On Aug 27, 11:36 am, Bo Yang <struggl...@gmail.com> wrote:
> Hi,
> I want to use sed -e 's/,/\n/g' file to replace all "," to new line.
> But I failed. Could anyone give me some advice?
>

put a litteral newline escaped with \ :

sed 's/,/\
/g'

or prefer:

tr ',' '\n'

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com