multiline CSV records (comma-separated values format)

Y

Yakov

Which CVS parser on cpan supports multiline CSV fields/records ?
Searching for CSV modules on cpan, I get impression that most of
them do not suport multiline values.
Which cvs parser support multiline fields ?

I have cvs data from my pda, and lots of records contain multiline
fields.

Thanks
Yakov
 
M

Mumia W.

Which CVS parser on cpan supports multiline CSV fields/records ?
Searching for CSV modules on cpan, I get impression that most of
them do not suport multiline values.
Which cvs parser support multiline fields ?

I have cvs data from my pda, and lots of records contain multiline
fields.

Thanks
Yakov

Text::CSV_XS supports multiline values if you use the 'binary' option.
 
Y

Yakov

Clearly there exists a delimiter between records, even if
records span multiple lines.

In multiline CSV, odd number of double-quotes in the record signals
the unfinished record.
This is how multiline CSV works. The record delimiter in multiline
CSV is \n, same as in
single-line CSV. Remotely like in multiline "..." perl string, newline
is just embedded into double-quoted csv field (except that ["] is
escaped by doubling it rather than turning it into \").
In multiline CSV, \n is also end of CSV record, and also the eof
embedded in the csv field.

Here is example of one csv record containing 2 fields, each being
multiline:

"first line of field 1 record 1...
second line of field 1 record 1","first line of field 2 record 1...
second line of field 2 record 1"


Yakov
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top