in reply to Text::CSV_XS and line-endings

If you have the option, rather than using getline ($io) you could pull the lines out yourself and hand them to parse ($line) (use fields () to get a getline equivelent result list).


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Text::CSV_XS and line-endings
by samtregar (Abbot) on Mar 16, 2006 at 22:19 UTC
    That won't work with rows containing new-lines, which is very common in CSV data. Text::CSV_XS handles this when given the binary option.

    -sam

      Although in that case OP is pretty stuffed in any case. He would almost have to write a replacement for CVS_XS to deal with the problem - no fun at all!


      DWIM is Perl's answer to Gödel
        Well, that's the case we're in (I work with friedo). If nothing else will work we can just use mac2unix if a scan of the first part of the file sees \r's and no \n's. It's a nasty hack but much better than reimplementing Text::CSV_XS!

        -sam