in reply to Re: Stripping non alphanumeric characters and leaving punctuation characters from a file
in thread Stripping non alphanumeric characters and leaving punctuation characters from a file
I thought that since it was a text file, or at least I thought it was that I shouldn't go in to binmode.
However, since then svsingh helped me to get this working. I've modified his code to this:
#!/usr/bin/perl -w use strict; open FH, 'pub71.html'; binmode FH; $\ = "<BR>"; while (<FH>) { next if $_ =~ /\,/; next if $_ =~ /^[a-z]/; if ( m/(.+)\s(\d{1,2}\.\d{2})%\s(.+)\s*<BR>/ ) { print "City:$1\tCounty:$3\tTax$2\n"; } } close FH;
and it now reads all the information that I want.
There is no emoticon for what I'm feeling now.
|
|---|