How you get the data? From a CGI-FORM? or STDIN?
Suppose you get the data from a string format...
I will do in this way..

$value_list =~ s/,/COMMA/eg;
@data = split(/,/, $value_list);

... expressions.....
... expressions.....
... expressions.....

($d0_value0, d0_$value1, $d0_value2) = split(/COMMA/, $data[0]);
($d1_value0, d1_$value1, $d1_value2) = split(/COMMA/, $data[1]);

... expressions.....
... expressions.....
... expressions.....




> > Hi all,
> >
> >  I have a line that has each field separated by commas. However, some of
> > individual fields are double quoted strings and also have embedded
commas in
> > them. for example:
> >
> > Value1,"Value2, blah,blah,blah",Value3,"Value4,blah",Value5
> >
> > When I use the split function using the split pattern of /,/ it
obviously
> > doesn't work.
> >
> > I believe what I want is to split on all commas when they are not
followed by
> > anything, then a double quote , then another comma.
> >
> > This seems like it should be a simple string to split into array values,
but I
> > just can't seem to get it to work.
> > Anybody have any suggestions?


Reply via email to