|
Grep for Multiple patterns
Hi All,
I have a file. I need to find multiple patterns in a row and need those rows to divert to new file.
I tried using grep -e / -E / -F options as given in man.
But its not working.
==> cat testgrep.txt
william,fernandes,xxxxx
mark,morsov,yyyy
yy=,xx=
yyyy=,xxxx==
==> /usr/xpg4/bin/grep -E 'yy xx' testgrep.txt
It gives not output.
==> /usr/xpg4/bin/grep -F 'yy xx' testgrep.txt
I used pattern file as well
==> cat patterngrep.txt
yy\n
xx\n
/usr/xpg4/bin/grep -e patterngrep.txt testgrep.txt
It is not working.
Please let me if we have anyother method of doing it.
Thanks,
|