This script takes a text file and parses two types of lines;
Customer name and Message-Id. Unfortunately, there are usually
two Message-Id tags per email. Anybody know how I would get the
script to ignore the second one?
Here is the code:
#!/usr/bin/perl
$textfile = "iwn.txt";
open (TEXT, "$textfile") || die "Con't Open $textfile";
@text=<TEXT>;
close(TEXT);
$glob = @text;
for($i=0; $i<$glob; $i++){
$_ = @text[$i];
if(/Email address:/){
print $_;
}
elsif(/Message-Id:/){
print $_;
}
}
Here are the current results with two emails:
Email address: 19324213@glerp
Message-Id: <200103160515.WAA07878@mal.elp.rr.com>
Message-Id: <200103160515.WAA07878@mal.elp.rr.com>
Email address: 19075680@glerp
Message-Id: <200103150512.VAA27508@prxy3.ba.best.com>
Message-Id: <200103150512.VAA27508@prxy3.ba.best.com>
Any advice would be much appreciated.
Thanks