in reply to problems parsing CSV

Personally, I would try to clean up the problem at the source first, but I'm well aware that this is not always possible.

You can identify your stray double quotes, as they are (likely) not preceded or followed by a comma. Also, the number of elements per row should remain constant. This will make it fairly easy to write a cleanup program, or at least a program that flags the invalid lines for manual correction:

#!perl -w my $columncount; while (<>) { print "Line $. has invalid quotes: $_" if (/[^,]"[^,]/); # Let's try to fix that line automatically: s/([^,])"([^,])/$1""$2/g; my @columns = /([^",]+)|"([^"]+|"")"/g; $columncount ||= @columns; if ($columncount <> 0+@columns) { print "Line $. has weird commas and needs even more manual int +ervention."; }; };