Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extracting from a text file - exlude

Status
Not open for further replies.

natv

Programmer
Jun 5, 2007
3
Hi guys,

This is probably just a command and not a script that I need to use, but I'm trying to figure out how to do this.

I have a list of email addresses. I want to extract all the email addresses EXCEPT yahoo.com emails.

In other words, I want to strip out the yahoo.com emails (or reversely, grep out just the lines that do not have yahoo.com in them)

grep has an --exclude command that doesn't seem to be what I need.


Any ideas?


Thanks
Nat


 
Depending on how (in)consistent your file is in upper/lower case, you might want to use:

grep -iv 'yahoo\.com' /path/to/your/datafile


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top