Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!sci.kun.nl!cs.kun.nl!hansm From: hansm@cs.kun.nl (Hans Mulder) Newsgroups: comp.editors Subject: Re: Global Empty Line Removal in vi? Message-ID: <2692@wn1.sci.kun.nl> Date: 25 Jan 91 10:07:51 GMT References: <1991Jan24.172344.28877@Veritas.COM> Sender: root@sci.kun.nl Organization: University of Nijmegen, The Netherlands Lines: 26 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. Have a nice day, Hans Mulder hansm@cs.kun.nl