[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need a shell or perl script



On Sun, Feb 22, 2004 at 10:51:58PM +0530, Deboo wrote:
} Over the years, I have been using many email clients from windows to linux
} and have been saving lots of old personal emails. I have many them in many
} different formats as per the MUA. They are a lot.
} 
} Now, I could search for one or two email addresses whenever I need to,
} having kept all these different mailboxes in one directory. Never having
} made an addressbook, is what caused this problem. I would like to sort,
} search and make a list of the email addresses. I know qute many of these
} addresses have become invalid over the years and some friends' addresses
} are more than one or two, but still a list would be nice. I know it can be
} done with shell scripting and better with perl but I know neither. Not
} that I do not want to learn, but I need help to get this list. Can anyone
} help me out by giving the commands needed to do this? If they think this I
} am asking for mass e-mail, then I could make a dir listing of the
} mailboxes and send you the list so you know these are my friends and not
} some spam thing I am asking.

I'm assuming your mailboxes are in some reasonable format where email
addresses are encoded in ascii and separated from other text by either
space or control characters. This is a moderately reasonable assumption.

cat <all mail files> |\
awk -F '[ \000-\0026]' '/@/ { for (i=0;i<NF;++i) if ($i ~ "/@/") print $i; }' |\
sort -fu

Perl? We don't need no stinkin' perl.

} Thanks and Regards,
} Deboo
--Greg



Reply to: