On Fri, 15 Jun 2001, Robert Watterson <[EMAIL PROTECTED]> wrote,

> 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?

use Text::ParseWords;

{
from perlfaq4:
    How can I split a [character] delimited string except
    when inside [character]? (Comma-separated files)
}

__END__
-- 
s::a::n->http(www.trabas.com)

Reply via email to