Command or script to get a list of email addresses

D

Deboo

I have quite many irc chat logs and in many of these, there are email
addresses of friends they haf given me during those chats. Can someone
help me make a perl script or tell me the command which would extract
these email addresses from these text files ( and may be also mbox files)
and also irradicate duplicates and put them in a list form in to a text
file?

I tried using grep but then there are some duplicates too and finding
and removing them would be a big hassle.

Thanks,
Deboo
 
C

Clay Irving

I have quite many irc chat logs and in many of these, there are email
addresses of friends they haf given me during those chats. Can someone
help me make a perl script or tell me the command which would extract
these email addresses from these text files ( and may be also mbox files)
and also irradicate duplicates and put them in a list form in to a text
file?

I tried using grep but then there are some duplicates too and finding
and removing them would be a big hassle.

Email::Find

NAME
Email::Find - Find RFC 822 email addresses in plain text

SYNOPSIS
use Email::Find;

# new object oriented interface
my $finder = Email::Find->new(\&callback);
my $num_found - $finder->find(\$text);

# good old functional style
$num_found = find_emails($text, \&callback);

DESCRIPTION
Email::Find is a module for finding a *subset* of RFC 822 email
addresses in arbitrary text (see the section on "CAVEATS"). The
addresses it finds are not guaranteed to exist or even actually be email
addresses at all (see the section on "CAVEATS"), but they will be valid
RFC 822 syntax.

Email::Find will perform some heuristics to avoid some of the more
obvious red herrings and false addresses, but there's only so much which
can be done without a human.
[...]
 
C

Carsten Aulbert

Deboo said:
I tried using grep but then there are some duplicates too and finding
and removing them would be a big hassle.

If you are just worried about duplicates, try

Your_Grep|sort|uniq
or
Your_Grep|sort -u (not 100% sure this will work all the time)

Of course, you can do similar things in perl...

Carsten
 
J

Josh

Well this has nothing to with perl but do
grep -whatever you were doing- | uniq

Uniq.. for unique... removes duplicates.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top