Count unique domains in email list
This EnScript was written by request for someone doing an email spam case and he needed to parse a large list of email addresses and then extract only the unique domain names.
So in this case, he had a very large ASCII file containing thousands and thousands of email addresses, some of which came from the same organization and had the same domain, but different email address. He needed a way to just create a list of just the unique domain names. This EnScript takes an ASCII file, with one email per line, line-delimited with a CRLF like this:
john@test.com
dave@test.com
steve@test.com
mike@mydomain.com
tom@mydomain.com
joe@mydomain.com
etc...etc...etc...
The output of the EnScript in the CONSOLE tab would be:
test.com (2)
mydomain.com (3)
This is a pretty specialized EnScript, but others may have a use for it as well.
Download Here
3 comments:
That's nice. Of course, treating the @ symbol as a delimiter and importing the data into a 2 column excel spread sheet, you could obtain the same information in just a few minutes.
Or you could use Perl, not requiring that you have EnCase... ;-)
Or a trivial shell pipeline:
cat in.txt | cut -d @ -f 2 | sort | uniq > out.txt
Post a Comment