[K12OSN] Help with sed script!

Timothy Legge timlegge at gmail.com
Thu Aug 9 17:27:02 UTC 2007


> Hi
>
> I like sed but the easiest way might be to open in gvim and do a
> search and replace of \n for nothing.
>

Hi

I had a few minutes so:

sed '/^$/d' filename

will remove the blank lines (all blank lines in the file).  If you are
particular (only the ones after member) you need

cat filename | perl -lp0e 's/DC=LO\n.*CAL/DC=LOCAL\n/g'

will combine the lines (if the break is at LO)

sed operates only on one line at a lime.  Perl in paragraph mode can
combine the lines...

tim




More information about the K12OSN mailing list