Tie::Handle::CSV and newlines

Tie::Handle::CSV and newlines

am 01.02.2007 07:47:01 von Mathias Koerber

using Text::CSV_XS with the 'binary' option, I can create a CSV file
which contains fields which have newlines.

Excel will read that file just fine.

When trying to read back such a file using Tie::Handle::CSV,
even when specifying the 'binary' option, the
program barfs when it encounters the first line which
contains a field crossing a newline.

Is there any reliable way to be able to create and read
back files CSV files which include fields with newlines?

merci

Re: Tie::Handle::CSV and newlines

am 01.02.2007 10:03:48 von paduille.4060.mumia.w+nospam

On 02/01/2007 12:47 AM, Mathias Körber wrote:
> using Text::CSV_XS with the 'binary' option, I can create a CSV file
> which contains fields which have newlines.
>
> Excel will read that file just fine.
>
> When trying to read back such a file using Tie::Handle::CSV, even
> when specifying the 'binary' option, the program barfs when it
> encounters the first line which contains a field crossing a newline.
>
> Is there any reliable way to be able to create and read back files
> CSV files which include fields with newlines?
>
> merci

From
http://search.cpan.org/~danboo/Tie-Handle-CSV-0.05/lib/Tie/H andle/CSV.pm :

> csv_parser
>
> Internally, Text::CSV_XS is used to do CSV parsing and construction.
> By default the Text::CSV_XS instance is instantiated with no
> arguments. If other behaviors are desired, you can create your own
> instance and pass it as the value to this option.


--
Windows Vista and your freedom in conflict:
http://www.regdeveloper.co.uk/2006/10/29/microsoft_vista_eul a_analysis/

Re: Tie::Handle::CSV and newlines

am 01.02.2007 10:11:23 von Mathias Koerber

Mumia W. (NOSPAM) wrote:
>> csv_parser
>>
>> Internally, Text::CSV_XS is used to do CSV parsing and construction.
>> By default the Text::CSV_XS instance is instantiated with no
>> arguments. If other behaviors are desired, you can create your own
>> instance and pass it as the value to this option.

tried that with the binary option too. no luck.

had to resort to using Text::CSV_XS directly to make it work. Hmm