Ralph Shumaker wrote:
James G. Sack (jim) wrote:

Ralph Shumaker wrote:
3. If a quick & dirty solution might be acceptable, just run a chain of
4 searches.
..
Wait a minute. It occurs to me that you may know something I don't. Are you saying that there is a way to do a four part compound search in
vim?

Nah, sorry. I was just alluding to the same thing suggested by jhriv and
kc, namely something like

grep ada sample.txt | grep bub | grep crc | grep dod

Is there some reason (perhaps just curiosity?) for talking about doing
it within vim?

Mainly getting context along with the match. But probably more that all my recent usage of regex still has my neurons tingling. My use of grep has settled a bit during my recent grappling with regex.

Why do you need context? Perhaps if you used line numbers you could go and look in the original file to actually see where the lines came from. So the above then becomes:

$ grep -n ada sample.txt | grep bub | grep crc | grep dod

Your final output will then have a line number at the start of each line.

Gus


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to