On Fri, Nov 5, 2010 at 8:34 AM, jm <jm5...@gmail.com> wrote: > changing the formatting of the source file to enclose all fields in > double quotes is not an option. i'm trying to figure out a regex, > split, or some other functionality that will allow me to either > > 1. wrap each 'bare' field in double quotes (ignoring the embedded > commas in the encapsulated fields) or > 2. extract each field, automatically determining if commas should be > ignored inside double quotes >
Try the Text::CSV module<http://search.cpan.org/%7Emakamaka/Text-CSV-1.20/lib/Text/CSV.pm>. It handles all of these details for you. -- Robert Wohlfarth