Show quoted text> $ perl -pi -e's/"\0/"0/g' file.csv
Yes that's [almost] the exact command I use in fact :)
Show quoted text> Did you try to use "allow_loose_escapes" ?
I did try that and I still get the same error :(
C:\>perl -e "use
Text::CSV_XS;$csv=Text::CSV_XS->new({binary=>1,allow_loose_escapes=>1});open
$fh, '<t.txt';while($line =
$csv->getline($fh)){printf(qq{%s\n},$line->[1])};print
$csv->error_diag;close $fh"
2023EIQ - QUO character not allowed23
C:\>type t.txt
"Audit active: ""TRUE "[nul]","Desired:","Audit active: ""TRUE "[nul]"
Show quoted text> Can you expand on that? Why? How?
I clearly remember reading in the "todo" section that it was going to
eventually be possible to pass an array/string of the lines of a file (which
you could get via slurp or w/e) instead of a filehandle. Going back to find
it however I see it isn't there... guess I was daydreaming :(
My bad.
~Adam~
On Thu, Oct 30, 2008 at 10:54, h.m.brand@xs4all.nl via RT <
bug-Text-CSV_XS@rt.cpan.org> wrote:
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=40507 >
>
> On Thu, 30 Oct 2008 11:13:41 -0400, "Adam via RT" <
> bug-Text-CSV_XS@rt.cpan.org> wrote:
>
> > Okay. The output is generated using a third party tool so I will just
> have
> > to continue to pre-process it before parsing the file using your module.
> I
>
> $ perl -pi -e's/"\0/"0/g' file.csv
>
> Did you try to use "allow_loose_escapes" ?
>
> allow_loose_escapes
> By default, parsing fields that have "escape_char" characters that
> escape characters that do not need to be escaped, like:
>
> my $csv = Text::CSV_XS->new ({ escape_char => "\\" });
> $csv->parse (qq{1,"my bar\'s",baz,42});
>
> would result in a parse error. Though it is still bad practice to
> allow this format, this option enables you to treat all escape
> character sequences equal.
>
> my $csv = Text::CSV_XS->new ({ binary => 1, allow_loose_escapes => 1 });
>
> > look forward to being able to pass an array in instead of only a file
> > handle...
>
> Can you expand on that? Why? How?
>
>
> --
> H.Merijn Brand Amsterdam Perl Mongers
http://amsterdam.pm.org/
> using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
> 11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
>
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
>
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
>
>