fredo2906 has asked for the wisdom of the Perl Monks concerning the following question:
The above will return : "Total Records : 12708" However, there aremy @o = `./convert.sh \"$filename\"`; my @array; foreach my $line (@o) { next if ($line =~ /^\s*$/); my %obj; my $error = getRecordObject($line,\%obj); print "Error code returned is $error for record\n$line\n" if ($err +or<0); push @array, \%obj; } .... doing something print "Total Records : ".scalar(@array)."\n";
cat ../file.converted | wc -l 12715
Those 6 records missing are actually lines containing double-bytes char.
20000 1 0 928 20 20131008100121164+09 79a87b78ade9ea2f4c059055ace98046.ñÿñÃÂûöÃÂóöÃÂ_<> 902
How to make Perl accept those lines ? Thanks a lot.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Double-bytes handling with Perl
by kcott (Archbishop) on Oct 10, 2013 at 08:29 UTC | |
|
Re: Double-bytes handling with Perl
by Corion (Patriarch) on Oct 10, 2013 at 07:59 UTC | |
by fredo2906 (Acolyte) on Oct 10, 2013 at 08:02 UTC | |
|
Re: Double-bytes handling with Perl (UTF16 or UTF8)?
by Anonymous Monk on Oct 10, 2013 at 07:54 UTC | |
by fredo2906 (Acolyte) on Oct 10, 2013 at 08:05 UTC | |
by fredo2906 (Acolyte) on Oct 10, 2013 at 08:10 UTC |