Tie::Handle::CSV and newlines

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
Mathias Koerber [ Do, 01 Februar 2007 07:47 ] [ ID #1615973 ]

Re: Tie::Handle::CSV and newlines

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/
paduille.4060.mumia.w[1] [ Do, 01 Februar 2007 10:03 ] [ ID #1615975 ]

Re: Tie::Handle::CSV and newlines

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
Mathias Koerber [ Do, 01 Februar 2007 10:11 ] [ ID #1615976 ]
Perl » comp.lang.perl.modules » Tie::Handle::CSV and newlines

Vorheriges Thema: CGI module under Perl32?
Nächstes Thema: New Namespace?