Hi all:
I have a Netscape Mail address book from 6.x that for some reason will not export. The raw file contains all the email addresses I want to strip out, and each is preceeded by an "=" sign and followed by a "" sign. I'm trying to come up with a good way to match anything between "=" and "" that also contains "@" (meaning it is an email address) and print each email address found to a separate line.
Here is what I have so far:
#!/usr/bin/perl
$| = 1;
open (FILE, "ab.nab" || die("Could not read file!"
@lines = <FILE>;
close (FILE);
foreach $line (@lines) {
$_ = $line;
if (/\=(\.*\@\.*)\)/ig) {
$_ = $1;
}
print STDOUT $_ . "\n";
}
For some reason it's definitely not working. Any ideas on why my matching string is bad?
I have a Netscape Mail address book from 6.x that for some reason will not export. The raw file contains all the email addresses I want to strip out, and each is preceeded by an "=" sign and followed by a "" sign. I'm trying to come up with a good way to match anything between "=" and "" that also contains "@" (meaning it is an email address) and print each email address found to a separate line.
Here is what I have so far:
#!/usr/bin/perl
$| = 1;
open (FILE, "ab.nab" || die("Could not read file!"
@lines = <FILE>;
close (FILE);
foreach $line (@lines) {
$_ = $line;
if (/\=(\.*\@\.*)\)/ig) {
$_ = $1;
}
print STDOUT $_ . "\n";
}
For some reason it's definitely not working. Any ideas on why my matching string is bad?