Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by puns0steel

  1. puns0steel

    extracting zip codes from a file? it's pulling the whole line

    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"; } }
  2. puns0steel

    extracting zip codes from a file? it's pulling the whole line

    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...
  3. puns0steel

    extracting zip codes from a file? it's pulling the whole line

    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...
  4. puns0steel

    extracting zip codes from a file? it's pulling the whole line

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

Part and Inventory Search

Back
Top