i have csv files in the following format, where some fields are
enclosed in double quotes if they have commas embedded in them and all
other fields are simply comma-delimited without any encapsulation,
such as

     some,data,more,data,numbers,etc,"data with a , in the
datastream",yet more data,"possibly more embedded ,'s",and,so,on,,,

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

i know it should be relatively simple but i'm not yet fluent enough in
regex to grasp the necessary double quote exceptions.  any help is
greatly appreciated.

tia,
joe

-- 
since this is a gmail account, please verify the mailing list is
included in the reply to addresses

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to