searching/grepping for words "near" each other

VirginSnow at vfemail.net VirginSnow at vfemail.net
Thu Apr 30 11:35:55 EDT 2009


OK, I know we have a few grep gurus on this list...

I want to search a text file for a few (alphabetic) words which must
be "near" each other, but not necessarily on the same line.  "Near"
could be defined however you like... within a certain number of words
from each other, a certain number of charecters from each other, or
some similar constraint.

Is there any way to do this using grep?  If not, is there some other
tool (short of a desktop search engine) capable of doing this?

This seems like a rather elementary search task, so I figure someone
must have figured a convenient way to do it...

Any suggestions?


More information about the gnhlug-discuss mailing list