Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Trying to find missing closing quotes in CSV

by Tux (Monsignor)
on Sep 17, 2013 at 09:00 UTC ( #1054408=note: print w/ replies, xml ) Need Help??


in reply to Re: Trying to find missing closing quotes in CSV
in thread Trying to find missing closing quotes in CSV

Bad idea. In perfectly correct CSV, it is possible to have odd number of " perl line in many different ways. This is valid CSV (all lines with " have an odd number of "):

$ cat test.csv 1,"2,","3"04" 2,"newline there -> and more text for row 2",There 3,,Bah $ csv-check test.csv Checked test.csv with csv-check 1.5 using Text::CSV_XS 1.01 OK: rows: 3, columns: 3 sep = <,>, quo = <">, bin = <1>, eol = <"\n"> $

Parsing CSV with regular expressions and/or on perl default readline method is a dangerous path to walk.


Enjoy, Have FUN! H.Merijn


Comment on Re^2: Trying to find missing closing quotes in CSV
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2014-04-23 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (556 votes), past polls