Path: utzoo!utgpu!watserv1!watmath!att!rutgers!tut.cis.ohio-state.edu!cica!iuvax!noose.ecn.purdue.edu!ecn.purdue.edu!patkar From: patkar@ecn.purdue.edu (Anant Y Patkar) Newsgroups: comp.editors Subject: Re: A vi question Keywords: vi, substitute Message-ID: <1990Aug16.130232@ecn.purdue.edu> Date: 15 Aug 90 16:32:32 GMT References: <1990Aug12.194738.7902@ecn.purdue.edu> <14420003@hp-lsd.COS.HP.COM> <401@taumet.com> Sender: news@ecn.purdue.edu (USENET news) Reply-To: patkar@cn.ecn.purdue.edu Followup-To: comp.editors Distribution: na Organization: Purdue University Engineering Computer Network Lines: 27 In article <401@taumet.com>, steve@taumet.com (Stephen Clamage) writes: |> |:%s/cc*/c/g |> |:%s/oo*/o/g |> |:%s/ss*/s/g |> |> This then also changes |> 'accent' to 'acent' |> 'loop' to 'lop' |> 'ass' to 'as'. |> I wonder if that is what the original poster had in mind. Just to clear the confusion. What I needed was to change quadruple occurances of any letter to a single occurance. That means if I use individual substitute commands for each letter, I am stuck with 52 commands (some files I have need more commands to take care of some other characters). Also it should change only quadruple occurances. I don't want any spelling mistakes in the resulting file. The solutions I received my mail indicate that (possibly) there is no way to do this using the "ex" commands. You have to invoke some UNIX commands like 'sed' from inside vi to do this. Hope this helps! -- Anant (patkar@cn.ecn.purdue.edu)