I'm faced with a mailbox full of bounced/undeliverable messages and from that I need to extract all the e-mail addresses that need to be removed from our home-spun mass-mail program.
After messing around a whole bunch, installing a whole mess of different editors and tools that I downloaded from the internet, and wasting a lot of time I finally came up with a solution that works for complex search and replace operations yet uses only the tools that I already have: Excel and Expression Web. I was able to export a mailbox from outlook containing hundreds of messages, and I was able to strip the unique e-mail addresses for each message. Here's the steps I took (minus the figuring out and messing around that I did)…
To make the e-mails useful I exported them into a CSV. From there I took just the message text and pasted that into Microsoft Expression Web. To isolate the e-mail addresses from the rest of the garbage, I searched for this…
[a-zA-Z0-9_.-]#@[a-zA-Z0-9_.-]+
…and did a "find all." After that I took my search results and pasted them into a new document and then did a replace funciton where I replaced…
.*[ t<("']{[a-zA-Z0-9_.-]#@[a-zA-Z0-9_.-]+}.*
… with …
1
It worked, but there was some problem recognising usernames that had a dot in them. There were, naturally, a lot of duplicates, so I pasted that list back into excel and performed this…
=IF(COUNTIF(A1:A670,A1)>1,"",A1)
…in the column next to the e-mail addresses. That told me whether or not there are duplicates below the current line. I filled the formula down to the end of the column. I copied that column and pasted as values into the next column, then I sorted the values and I have a list of e-mails with no duplicates, ready to be used.