Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!sdd.hp.com!uakari.primate.wisc.edu!uflorida!haven!umbc3!math13.math.umbc.edu!rouben From: rouben@math13.math.umbc.edu (Rouben Rostamian) Newsgroups: comp.editors Subject: Re: Deleting lines in Vi Message-ID: <4541@umbc3.UMBC.EDU> Date: 28 Nov 90 05:13:15 GMT References: <980@sol.deakin.OZ.AU> Sender: newspost@umbc3.UMBC.EDU Reply-To: rouben@math13.math.umbc.edu.UUCP (Rouben Rostamian) Organization: Mathematics Department University of Maryland, Baltimore County Lines: 19 In article <980@sol.deakin.OZ.AU> carterp@cc.wbl.deakin.OZ.AU (Phil Carter) writes: >In Vi, how does one delete all lines containing a certain character >string? > >Similarly, how does one delete all lines NOT containing a certain >character string? To delete all lines containing "pattern": :g/pattern/d To delete all lines not containing "pattern": :v/pattern/d -- Rouben Rostamian Telephone: (301) 455-2458 Department of Mathematics and Statistics e-mail: University of Maryland Baltimore County bitnet: rostamian@umbc Baltimore, MD 21228, U.S.A. internet: rostamian@umbc3.umbc.edu