Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!csn!boulder!tramp.Colorado.EDU!lewis From: lewis@tramp.Colorado.EDU (LEWIS WILLIAM M JR) Newsgroups: comp.editors Subject: Re: VI question Message-ID: <1991Apr17.175446.20190@colorado.edu> Date: 17 Apr 91 17:54:46 GMT References: <1991Apr16.234809.23553@massey.ac.nz> Sender: news@colorado.edu (The Daily Planet) Organization: University of Colorado, Boulder Lines: 22 Nntp-Posting-Host: tramp.colorado.edu In article <1991Apr16.234809.23553@massey.ac.nz> R.Singh@massey.ac.nz (R. Singh) writes: >Get VI to recognize a pattern of two 4 lettered uppercase words and insert >a comma in them > >for eg > >XHLP XCEL >APPL XCEL > >and make them > >XHLP,XCEL >APPL,XCEL > Examples abbreviated. Instead of vi, use any AT&T version of 'ed' later than V7: g/[A-Z]\{4\} [A-Z]\{4\}/s/ /,/g If you don't know about \{n,m\} closures, see McGilton and Morgan "Introducing the Unix System" and if the version of 'ed' that came with your UNIX system doesn't support closures, get the real thing.