http://qs321.pair.com?node_id=414689


in reply to Re: Parsing a text file without newlines
in thread Parsing a text file without newlines

well i'm running the script on a linux machine, but i'm guessing the csv file was probably created on windows and has some funny windows encoding or something like that...?

I tried using Text::CSV_XS

my $csv = Text::CSV_XS->new({ 'quote_char' => '"', 'escape_char' => '"', 'sep_char' => ',', 'binary' => 1 });

I changed binary to 1 and that solved a similar problem I had with another csv file, but hasn't made a difference to this file.

Is there a setting somewhere for different types of files, like those created on windows or those from unix?

Replies are listed 'Best First'.
Re^3: Parsing a text file without newlines
by jZed (Prior) on Dec 14, 2004 at 16:42 UTC
    It sounds like you need to set the eol flag. Look at the file in a hex editor to find out what the line endings really are (your editor may hide some things) or else just experiment with eol set to \012 or \015\012 or \015.