Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!ll-xn!vlsi!young From: young@vlsi.ll.mit.edu (George Young) Newsgroups: comp.unix.questions Subject: sed script to combine blank lines? Keywords: sed Message-ID: <192@vlsi.ll.mit.edu> Date: 12 Oct 88 21:13:32 GMT Distribution: comp Organization: MIT Lincoln Laboratory, Lexington MA Lines: 25 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. I know there are various other unix tools that could do this, but sed looks like the most appropriate, and I would like to learn to use it's fancier facilities anyway. Any ideas? Just email response if this seems too trivial for broad posting. George Young, Rm. B-141 young@ll-vlsi.arpa MIT Lincoln Laboratory young@vlsi.ll.mit.edu 244 Wood St. Lexington, Massachusetts 02173 (617) 981-2756 . -- George Young, Rm. B-141 young@ll-vlsi.arpa MIT Lincoln Laboratory young@vlsi.ll.mit.edu 244 Wood St. Lexington, Massachusetts 02173 (617) 981-2756