Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Recommendations for parsing invalid CSV

by Tux (Canon)
on Apr 21, 2008 at 22:48 UTC ( [id://682041]=note: print w/replies, xml ) Need Help??


in reply to Recommendations for parsing invalid CSV

OK, I nailed it. C<allow_loose_quotes> now also works inside quoted fields, under the condition that the C<escape_char> is not equal to the C<quote_char>. Code like that is very unlikely to have some valid escape sequence anyway. From 0.43 onward, you can parse those lines with

my $csv = Text::CSV_XS->new ({ binary => 1, allow_loose_quotes => 1, escape_char => undef, });

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://682041]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-25 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found