I have this CSV file given to me to grab fields and compare/update against a
db following some rules. I'm having problems parsing the CSV file, though,
b/c of some certain characters.
I don't know what the characters are (newlines, \r's, etc [or some
combination of the above]) and I tried s//'ing them out to no avail. In
StarOffice, the characters appear as a "box". When Text::CSV (and I upgraded
to Text::CSV_XS) spits out the error, it appears that there are newlines in
there:
There was an error parsing oldfile.csv: 16NNNN,"John","Smith",,"OTHER
","McDonald's CORE Lab","123 Main St.",...
Thanks in advance for any of your help! Is there any way to identify what
those characters are?
Jason
Here's some of my code:
open ( FILE, shift );
@lines = <FILE>;
close ( FILE );
$csv = Text::CSV_XS->new();
foreach ( @lines ) {
chomp $_;
s/[\r\n]//g;
if ( $csv->parse( $_ ) ) {
...
} else {
print "There was an error..." . $csv->error_input . "\n";
}
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]