Attn unix geeks

I-R-BABOON

Got Hose?
Established Member
Joined
Nov 22, 2002
Messages
1,311
Location
dirtay jersay
My company has recently received around 5million (yes 5 million) e-mail address'
My boss wants me to sort these into catagories as such
aol_mail
compuserve_mail
hotmail_mail
msn_mail
earthlink_mail
yahoo_mail
and
other_mail

So far i have taken all the aol extentions and put them into aol_mail and the same for the other 5 mailboxes but i need to put the other email address' like netzero.com, optonline.com, etc into the other_mail file with out including any aol, compuserve, hotmail, msn, earthlink, and yahoo e-mail address'
Does anyone know how to accomplish this using the grep or other command?
 

norcal_cobra

Brand-X Eater
Established Member
Joined
Nov 18, 2002
Messages
473
Location
Norcal
Assuming you have these emails listed in a file called and that they are each on a line by themselves:
cat emailaddresses.txt | grep -v @aol.com | grep -v @compuserve.com | grep -v hotmail.com | grep -v ..... > otheremailaddresses.txt

This is what is referred to as a filter. The output will be in a file called otheremailaddresses.txt Hope this helps.

-norcal_cobra
 

derryck

New Member
Established Member
Joined
Nov 10, 2002
Messages
187
Location
Florida
Subscribe to UNIX HINTS... there's some really useful tips, like how to filter using grep.
 

Users who are viewing this thread



Top