Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpfcso!hpldola!hp-lsd!was From: was@hp-lsd.COS.HP.COM (Bill Stubblebine) Newsgroups: comp.editors Subject: Re: A vi question Message-ID: <14420004@hp-lsd.COS.HP.COM> Date: 20 Aug 90 01:23:14 GMT References: <1990Aug12.194738.7902@ecn.purdue.edu> Organization: HP Logic Systems Division - ColoSpgs, CO Lines: 66 > First off, if the sources I sent patkar@..... work, this is a dead > issue. the intent was to get rid of the overstriking done by nroff > (etc) for bold type. It would have helped if you had said initially that these were nroff overstrikes. In this case, it's easier to cure the problem than to cure the symptoms. Try: ... | nroff [options] | col -b NAME col - filter reverse line-feeds and backspaces SYNOPSIS col [ -blfxp ] DESCRIPTION (stuff deleted) If the -b option is given, col assumes that the output device in use is not capable of backspacing. In this case, if two or more characters are to appear in the same place, only the last one read will be output. (more stuff deleted) > Second, and here's where I may simply have more to learn about vi (which > is the case all the time.....), with your search/replace commands above, > what happens with strings such as "success", "pool", and so on? Well, you have a good point here. No editor I know of (other than a guy with a green eye shade and a red pencil) knows that two 'o's belong in 'loop', but only one belongs in 'lop'. > I guess the real question should be, does the "*" tell vi that you're > talking about strings of more than 2 of that character? The '*' in a regular expression (RE) means 0 or more occurrences of the character preceding the '*'. Thus, the RE 'cc*' means one or more adjacent instances of the character 'c'. If you cannot locate col(1) at your site, try this shell script, colorfully known as a 'here document': ex << ! r file %s/aaaa/a/g %s/bbbb/b/g ... %s/zzzz/z/g %s/AAAA/A/g %s/BBBB/B/g ... %s/ZZZZ/Z/g (...etc...) w q ! Bill Stubblebine Hewlett-Packard Logic Systems Div. 8245 N. Union Blvd. Colorado Springs, CO 80920 was@hp-lsd.hp.com (Internet) (719) 590-5568