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

Well I could read it, but only to a certain point. I could read the first 231 lines in text mode.

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.

  • Comment on Re: Re: Stripping non alphanumeric characters and leaving punctuation characters from a file
  • Download Code