thanks for the help, Kevin. I ended up using this:
use strict;
use warnings;
die "$0 <infile> <outfile>\n" unless @ARGV == 2;
open my $in, $ARGV[0] or die $!;
open my $out, '>', $ARGV[1] or die $!;
while (my $l = <$in>) {
if ($l =~ m/zip=(\d+)/) {
print $out $1, "\n";
}
}
it's not very pretty, but here it is:
<table border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="270" style="padding-right:5px;">
<a...
thanks for replying, Kevin. so what you said makes sense, but when make the change i end up with 2100 blank lines. If i take out the "\n" and just leave
print OUTFILE $1;
i get no results. does that mean it's a problem with the regex? i was getting data with the same regex before i made the...
I'm brand new to perl, so any help would be great! I'm using ActiveState on XP. I'm trying to extract only the zip codes from an html file and put them into another file separated with line breaks or commas or something so I can put them in a spreadsheet.
Here's the code i'm using (i got it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.