bt707
asked on
perl paragraph mode search
I use a perl command to search a group of lines like:
perl -00 -ne 'print if /keyword/' txtfile1
how can i make this find the groups that does NOT contain the key word i use.
In other words "if Not"
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Wouldnt a simple 'grep' be effeicient in this case.....
perl -00 -e 'print grep{not /keyword/}<>' txtfile1
would need to read the entire file into memory before printing anything.
would need to read the entire file into memory before printing anything.
I meant a Unix grep. That's supposed to be more optimized for this kind of things....no??
Yes, although Unix grep searches for lines, not paragraphs.
You could convert paragraphs to lines | grep | convert lines back to paragraphs
You could convert paragraphs to lines | grep | convert lines back to paragraphs
ASKER