Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: CSV Parser, with and without encapsulation

by Tux (Monsignor)
on Oct 25, 2012 at 08:14 UTC ( #1000785=note: print w/ replies, xml ) Need Help??


in reply to CSV Parser, with and without encapsulation

The "best" is of course Text::CSV_XS :)

Text::CSV is just a wrapper over Text::CSV_XS and/or Text::CSV_PP.

If your CSV data is mixed and invalid, chances are that you might not find a combination of options that will work on all records, but a good start for what you describe would be something like:

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

Please carefully read the manual for all allow_*** options.


Enjoy, Have FUN! H.Merijn


Comment on Re: CSV Parser, with and without encapsulation
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-07-29 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls