Re: [Evolution] Can I extract email addresses from emails?



On Thu, 2003-09-04 at 17:50, guenther wrote:
However, just started playing with this topic, as I got curious. This
perl one-liner does the trick pretty well -- although it will catch
unwanted header infos (like Message-Id:) as well, if it looks like a
valid email address.

$ perl -ne 'print "$1\n" while ( s/([\w.-]+@([\w-]+\.)+\w{2,})// )' ~/evolution/local/Inbox/mbox

Better:

egrep -vi '((Message-ID)|(References)|(X-Evolution-Source))\:' ~/evolution/local/Inbox/mbox | perl -ne 'print 
"$1\n" while ( s/([\w.-]+@([\w-]+\.)+\w{2,})// )

Still by no means perfect.

-- 
Toby A Inkster
Fundraising & IT
The National Childbirth Trust (UK Office)
Phone: 0870 770 3236
Fax: 0870 770 3237




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