Posted on 2006-11-22 20:49:09-08 by westbywest
Problem with line-endings inside fields of CSV files under Activestate Perl
I've noticed that line endings embedded within quoted fields of imported CSV files apparently get interpreted as line endings (i.e. corrupting the imported data), rather than as field data. The CSV files affected were generated with MSExcel (saved as MSDOS CSV format).

I've only observed this munging of line endings in Windows XP under Activestate Perl (v5.8.8 built for MSWin32-x86-multi-thread), using CTable module v. 1.0.1 and the most recent 1.0.3. I observe correct importing of line endings in WinXP under Cygwin Perl (v5.8.7 built for cygwin-thread-multi-64int), using CTable module 1.0.3.

I've tried playing with explicitly setting the _LineEnding parameter for file format settings, i.e.
_LineEnding => "unix"
or
_LineEnding => "dos"
, but neither appears to resolve the problem with ActiveState perl.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.