sed script to combine blank lines? (sed + awk solutions)

Michael Morrell morrell at hpsal2.HP.COM
Tue Oct 18 16:04:52 AEST 1988


/ hpsal2:comp.unix.questions / dave at lsuc.uucp (David Sherman) /  3:49 pm  Oct 16, 1988 /
Some versions of UNIX (including 4.1BSD) include a program
call ssp(1) which does this; it's a bit faster than the
parallel awk script.

Also, if you know your text doesn't contain duplicate lines
(nroff output almost always qualifies, for example), good
old uniq(1) will do it.
----------

I thought the original problem was to replace multiple "blank" lines with
a single newline (\n), where "blank" included lines with only tabs and
formfeeds on them.  ssp and uniq will only help if the lines to be combined
are really blank.



More information about the Comp.unix.questions mailing list