wrathkeg
September 28th, 2007, 09:42 AM
Hi,
I am trying to search through text files using grep (though if there is a better tool for the job, I could use something else). I want to identify all of the instances of the characters "a", "n", "d", in that order, but without spaces between them. I can do this:
grep "a.*n.*d" foo.txt
which seems to work, with the exception that it returns all lines with those characters, even when there is an intervening space.
Does anyone have any ideas?
TIA
WK
I am trying to search through text files using grep (though if there is a better tool for the job, I could use something else). I want to identify all of the instances of the characters "a", "n", "d", in that order, but without spaces between them. I can do this:
grep "a.*n.*d" foo.txt
which seems to work, with the exception that it returns all lines with those characters, even when there is an intervening space.
Does anyone have any ideas?
TIA
WK