Grep -v option

M

Mark Lockett

I am trying to parse lines out of a txt file. Instead of running the
command three times, how can I add all the parameters together for the
-v option. Thanks for the help.
 
J

Jon Ericson

I am trying to parse lines out of a txt file. Instead of running the
command three times, how can I add all the parameters together for the
-v option. Thanks for the help.

This isn't strictly a Perl question. In shell:

$ grep -v x filename | grep -v y | grep -v z

With perl:

$ perl -ne 'print unless /x|y|z/' filename

It sound's like you have some problem with the shell solution, but I
don't know what it might be.

Jon
 
M

Michele Dondi

I am trying to parse lines out of a txt file. Instead of running the
command three times, how can I add all the parameters together for the
-v option. Thanks for the help.

Are you asking about grep or perl? Hint: '|' *may* be what you want in
both cases...


Michele
 
J

Jürgen Exner

Mark said:
I am trying to parse lines out of a txt file. Instead of running the
command three times, how can I add all the parameters together for the
-v option.

Which -v option are you talking about? "perldoc -f grep" doesn't mention it.

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,901
Members
47,439
Latest member
elif2sghost

Latest Threads

Top