Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!gatech!nascom!rar From: rar@nascom.UUCP (Alan Ramacher) Newsgroups: comp.unix.questions Subject: Re: sed script to combine blank lines? Summary: use awk not sed Keywords: sed Message-ID: <136@nascom.UUCP> Date: 13 Oct 88 15:36:16 GMT References: <192@vlsi.ll.mit.edu> Distribution: comp Organization: National Advanced Systems, Atlanta, Ga. Lines: 14 In article <192@vlsi.ll.mit.edu>, young@vlsi.ll.mit.edu (George Young) writes: > Is there a 'sed' wizard out there? I often want to take a big ascii file > (like a .c file after cc -E) and collapse each group of 'blank' lines > into exactly one blank line. 'Blank' here is any combination of blanks, > tabs and maybe ^L's. It looks from the documentation that sed should do this > quite neatly, using the multiple line pattern space commands with imbedded > newlines, but I sure can't figure out how. I'd prefer the resulting blank > line to be just a newline. sed is not powerful enuf for the job, but a simple awk script will work. If you have difficulties writting it, let me know and I will supply one. Good luck. Allan Ramacher