in reply to Re: Re: CSV file
in thread CSV file

Is every field in quotes, then? If so, you might be able to read lines until you match quote-newline at the end of a line, strip the leading and trailing quotes, then split the whole mess on /",\s*"/. Like so (untested):
my $line = ''; my @fields; while (<>) { $line .= $_; if (/"\n/ or eof) { $line =~ s/^"//; $line =~ s/"$//; @fields = split(/",\s*/); $line = ''; } }

The PerlMonk tr/// Advocate

Replies are listed 'Best First'.
Re: Re^3: CSV file
by xorl (Deacon) on Mar 09, 2004 at 17:27 UTC
    This looks like it just might work. I will test it and work along these lines. Every field is should be enclosed in quotes and in briefly looking at the files I don't see where splitting on ",\s would be a problem. Thanks!