Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!roundup.crhc.uiuc.edu!ux1.cso.uiuc.edu!cs.uiuc.edu!joshi From: joshi@cs.uiuc.edu (Anil Joshi) Newsgroups: comp.editors Subject: Re: Global Empty Line Removal in vi? Message-ID: <1991Jan25.182043.10324@cs.uiuc.edu> Date: 25 Jan 91 18:20:43 GMT References: <1991Jan24.172344.28877@Veritas.COM> <2692@wn1.sci.kun.nl> Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL Lines: 36 hansm@cs.kun.nl (Hans Mulder) writes: >In article <1991Jan24.172344.28877@Veritas.COM> geoff@Veritas.COM (Geoffrey Leach) writes: >>From article , by chris@bilby.cs.uwa.oz.au (chris mcdonald): >>> In <1991Jan24.064310.8077@midway.uchicago.edu> zi0h@quads.uchicago.edu (W. Ishii) writes: >>> >>>>Hello there! As a vi novice (maybe a stronger term is called for--vi idiot, >>>>probably), I've been stuck for about a week now trying to figure out how to >>>>globally remove multiple blank lines from text. >>> >>> Filter the whole file (with !! ) through cat -s >> >>Try ":g/^$/d" >Try _reading_ the question before you answer. Chris said _multiple_ blank lines. >The best you can do using the :g command would be >:g/^$/+s//This_line_must_be_deleted >:g/This_line_must_be_deleted/d >But using 1G!Gcat -s is easier. What a pain to do such a simple thing in vi. ISPF solution is exclude blank lines delete all exculded lines Anil ISPFBigot -- "Whatever we wish ourselves to be, we have the power to make ourselves. If what we are now has been the result of our own past actions,then it certainly follows that whatever we wish to be in the future, can be produced by our own present actions. how to act." - Vivekananda, Late Nineteenth Century Indian Philosopher