Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.misc > #12180
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | Mladen Gogala <gogala.mladen@gmail.com> |
| Newsgroups | comp.os.linux.misc |
| Subject | Re: Script to parse a text file and extract unique email addresses |
| Date | Mon, 29 Sep 2014 00:17:34 +0000 (UTC) |
| Organization | solani.org |
| Lines | 40 |
| Message-ID | <pan.2014.09.29.00.17.34@gmail.com> (permalink) |
| References | <da031cdc-9a9e-444e-a951-13ad4fdf5b93@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8bit |
| X-Trace | solani.org 1411949854 17300 eJwFwQcBADAIAzBLO1w5HVD/EpbotW3lYmqiVGJdBiDp0t6beIF5jc4KjzmH06jOoz6+hh892RKO (29 Sep 2014 00:17:34 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Mon, 29 Sep 2014 00:17:34 +0000 (UTC) |
| User-Agent | Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) |
| X-User-ID | eJwVx8ERwDAIA7CVKNgOjNPQsP8Iueonhh71gihwOFNv7ozAaRGNv55WTq/9Dap9EjKlnViyCxWaEFs= |
| Cancel-Lock | sha1:kcYlhXmu769b2P6r45n2HcIOxtg= |
| X-NNTP-Posting-Host | eJwFwYEBgDAIA7CXZNCC50wo/59gAqexMwgGFpvWrW8aHHF8YRcP7a4UddLrlMpkg2h/M34xjxE7 |
| Xref | csiph.com comp.os.linux.misc:12180 |
Show key headers only | View raw
On Tue, 19 Aug 2014 10:19:24 -0700, nomdeplume82008 wrote:
> Hi all,
>
> My scripting is a v. rusty and I am trying to write a script that will extract unique email addresses from an out Outlook file to build an address book.
>
> In the output file, all the email addresses should preferably be in a single alphabetical column.
>
> Any suggestions on how to do it?
>
> Thanks.
Here is my take:
#!/usr/bin/env perl
use warnings;
use strict;
my %EMAILS;
while (<>) {
if (/([a-z0-9.-]+\@[a-z0-9.-]+)/i) {
if ( !defined( $EMAILS{$1} ) ) {
$EMAILS{$1} = 1;
}
else { next; }
}
else { next; }
}
foreach my $addr ( sort keys %EMAILS ) {
print "$addr\n";
}
--
Mladen Gogala
The Oracle Whisperer
http://mgogala.byethost5.com
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Script to parse a text file and extract unique email addresses nomdeplume82008@googlemail.com - 2014-08-19 10:19 -0700
Re: Script to parse a text file and extract unique email addresses Andreas Kohlbach <aug14.8.ankman@spamgourmet.com> - 2014-08-19 16:40 -0400
Re: Script to parse a text file and extract unique email addresses The Natural Philosopher <tnp@invalid.invalid> - 2014-08-20 14:21 +0100
Re: Script to parse a text file and extract unique email addresses nomdeplume82008@googlemail.com - 2014-08-20 08:52 -0700
Re: Script to parse a text file and extract unique email addresses Andreas Kohlbach <aug14.8.ankman@spamgourmet.com> - 2014-08-20 18:26 -0400
Re: Script to parse a text file and extract unique email addresses nomdeplume82008@googlemail.com - 2014-08-20 21:10 -0700
Re: Script to parse a text file and extract unique email addresses Andreas Kohlbach <aug14.8.ankman@spamgourmet.com> - 2014-08-21 18:07 -0400
Re: Script to parse a text file and extract unique email addresses Tim Watts <tw_usenet@dionic.net> - 2014-08-21 10:53 +0100
Re: Script to parse a text file and extract unique email addresses Andreas Kohlbach <aug14.8.ankman@spamgourmet.com> - 2014-08-21 18:03 -0400
Re: Script to parse a text file and extract unique email addresses Bill Marcum <bill.marcum57@yahoo.com> - 2014-08-21 03:34 -0400
Re: Script to parse a text file and extract unique email addresses The Natural Philosopher <tnp@invalid.invalid> - 2014-08-21 12:12 +0100
Re: Script to parse a text file and extract unique email addresses Chris Davies <chris-usenet@roaima.co.uk> - 2014-08-21 12:12 +0100
Re: Script to parse a text file and extract unique email addresses The Natural Philosopher <tnp@invalid.invalid> - 2014-08-21 14:22 +0100
Write it in C... (Was: Script to parse a text file and extract unique email addresses) gazelle@shell.xmission.com (Kenny McCormack) - 2014-08-21 13:42 +0000
Re: Write it in C... (Was: Script to parse a text file and extract unique email addresses) The Natural Philosopher <tnp@invalid.invalid> - 2014-08-21 15:23 +0100
Re: Write it in C... Rich <rich@example.invalid> - 2014-08-21 16:17 +0000
Re: Write it in C... The Natural Philosopher <tnp@invalid.invalid> - 2014-08-21 18:42 +0100
Re: Write it in C... William Unruh <unruh@invalid.ca> - 2014-08-21 18:38 +0000
Re: Script to parse a text file and extract unique email addresses Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2014-09-24 13:18 +0000
Re: Script to parse a text file and extract unique email addresses Doug Laidlaw <laidlaws@hotkey.net.au> - 2014-09-25 01:49 +1000
Re: Script to parse a text file and extract unique email addresses Loki Harfagr <l0k1@thedarkdesign.free.fr.INVALID> - 2014-09-25 09:34 +0000
Re: Script to parse a text file and extract unique email addresses Mladen Gogala <gogala.mladen@gmail.com> - 2014-09-29 00:17 +0000
Re: Script to parse a text file and extract unique email addresses Rich <rich@example.invalid> - 2014-09-29 00:52 +0000
Re: Script to parse a text file and extract unique email addresses gazelle@shell.xmission.com (Kenny McCormack) - 2014-09-29 01:13 +0000
Re: Script to parse a text file and extract unique email addresses Tim Watts <tw_usenet@dionic.net> - 2014-09-29 07:40 +0100
Re: Script to parse a text file and extract unique email addresses Eric Pozharski <whynot@pozharski.name> - 2014-09-29 09:52 +0300
csiph-web