Path: utzoo!attcan!uunet!mcsun!ukc!stl!ndh From: ndh@stl.stc.co.uk (Neale D Hind ) Newsgroups: comp.editors Subject: Re: Global Empty Line Removal in vi? Message-ID: <3989@stl.stc.co.uk> Date: 31 Jan 91 09:09:51 GMT References: <1991Jan24.163844.7521@unmvax.cs.unm.edu> <1991Jan26.233521.17721@ddsw1.MCS.COM> <1991Jan27.073848.27626@ddsw1.MCS.COM> <1991Jan30.001551.7538@unmvax.cs.unm.edu> Sender: news@stl.stc.co.uk Reply-To: "Neale D Hind " Organization: STC Technology Limited, London Road, Harlow, Essex, UK Lines: 17 In the referenced article crowley@unmvax.cs.unm.edu (Charlie Crowley) writes: >I found a way (albeit complex) to do it from within vi. >(1) find a string that does not occur anywhere in the text. I will use >(2) replace all blank lines withi this string >(3) Join all such lines. This must be done one step at a time where >(4) Replace the first one of these with a newline. >(5) Remove all the extra 'qqq 's. >Okay, it is complex. It did it in X by having the command lines in a file Surely if you know which blank line you want to keep, it would be simpler to use one of the other methods to remove all blank lines and then manually insert the one you wanted to keep. My contribution was :g/^[spacetabformfeed]*$/d from witihn vi. ---- Neale D. Hind - (N.D.Hind@stl.stc.co.uk)