Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!mit-eddie!uw-beaver!ubc-cs!alberta!mts.ucs.UAlberta.CA!ualtavm!GHAVERLA From: GHAVERLA@vm.ucs.UAlberta.CA (G Haverland) Newsgroups: comp.editors Subject: Re: DELIMITED search Message-ID: <1092@vm.ucs.UAlberta.CA> Date: 31 Oct 90 14:25:30 GMT References: <1990Oct29.134654.18929@cid.aes.doe.CA> Reply-To: GHAVERLA@vm.ucs.UAlberta.CA Distribution: na Organization: University of Alberta VM/CMS Lines: 25 Disclaimer: Author bears full responsibility for contents of this article In article <1990Oct29.134654.18929@cid.aes.doe.CA>, afsipmh@cidsv01.cid.aes.doe.CA writes: > > How, in general, can I do delimited searches in UNIX. i.e. How do I > search for say the string "the" without finding there their other > thesaurus...... AND including "the" at the beginning and end of a line > eh? > >-- >Pat Hertel Canadian Meteorological Centre >Analyst/Programmer 2121 N. Service Rd. % rm God >phertel@cmc.aes.doe.ca Dorval,Quebec rm: God non-existent >Environment Canada CANADA H9P1J3 Not sure what UNIX programs you are using, and exactly what your needs are, but the following will work. Search for three different strings, and then combine the results. The first string to look for is " the " (the in spaces), the next to look for is "%the" (sorry caret (begining of line character) doesn't exist on this VM machine), and the last to look for is "the$" (look for the at end of line). grep can be told to ignore case (-i) if this is what you are using. If vi or emacs, there should be a magic variable that can be set before doing the search. Gordon Haverland, U of Alberta SLOWPOKE Facility