Unix Shell - Re: SED question: entering a blank line above a character searched

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2007 > Re: SED question: entering a blank line above a character searched





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 Re: SED question: entering a blank line above a character searched
Cyrus Kriticos

2007-12-28, 7:31 am

Kompu Kid wrote:
> After finding a ":", I would like to enter a blank line above the line
> that the colon is found.
>
> How do I do this with SED?


[GNU sed]

sed 's/\(.*:.*\)/\n\1/' filename

--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com