Command or script to get a list of email addresses

Discussion in 'Perl Misc' started by Deboo, Jul 31, 2003.

  1. Deboo

    Deboo Guest

    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
     
    Deboo, Jul 31, 2003
    #1
    1. Advertising

  2. Deboo

    Clay Irving Guest

    In article <bgbn37$n4g7d$-berlin.de>, Deboo wrote:

    > 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.
    [...]

    --
    Clay Irving <>
     
    Clay Irving, Jul 31, 2003
    #2
    1. Advertising

  3. Deboo wrote:
    > 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
     
    Carsten Aulbert, Aug 1, 2003
    #3
  4. Deboo

    Josh Guest

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

    Uniq.. for unique... removes duplicates.
    "Deboo" <> wrote in message
    news:bgbn37$n4g7d$-berlin.de...
    >
    > 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
     
    Josh, Aug 3, 2003
    #4
  5. On Thu, 31 Jul 2003 18:27:52 +0000, Deboo wrote:

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

    did you try uniq with grep ?
     
    Mohammed Sameer, Aug 5, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Duke of Hazard
    Replies:
    0
    Views:
    767
    Duke of Hazard
    Jan 23, 2004
  2. Kelly
    Replies:
    1
    Views:
    428
    The Durban Towel
    Apr 28, 2004
  3. svirdi

    Get list of all IP addresses

    svirdi, Aug 8, 2006, in forum: C++
    Replies:
    2
    Views:
    446
    Default User
    Aug 8, 2006
  4. namespace1
    Replies:
    3
    Views:
    922
  5. pbd22
    Replies:
    1
    Views:
    167
Loading...

Share This Page