$csv->error_diag()
####
$status = $csv->parse($line);
printf "status=%d\n", $status;
unless ($status) {
printf "error=%d %s\n", ( $csv->error_diag());
}
@col = $csv->fields();
print Dumper \@col;
##
##
"fred1234","bedrock quary","S","t","88579Y101","4851","2595708","US88579Y1010","MMM","3M CO","USD","USD","SB7",1,19610718,19610718,225212,"MMM UN","MMM.N","",1,"C",710.964086349999,710.964086349999,710.96408635,,,2.45938,,,,"R" ~~
status=0
error=2027 EIQ - Quoted field not terminated
$VAR1 = [
undef
];
--new line--
##
##
#! perl -w
use strict;
use Text::CSV_PP;
use Data::Dumper;
$csv = Text::CSV_PP->new(); # create a new CSV parser object
while (defined($line = <> )) {
chomp $line;
$line =~ s/\" $/\"/; ### kludge to remove space after the last doublequote, if any
print $line . "~~\n";
$status = $csv->parse($line);
printf "status=%d\n", $status;
unless ($status) {
printf "error=%d %s\n", ( $csv->error_diag ());
}
@col = $csv->fields();
print Dumper \@col;
print "--new line--\n";
} #while