in reply to Re: Re: Splitting a comma-delimited string where a substring could countain commas
in thread Splitting a comma-delimited string where a substring could contain commas

If the whole field were in parenthesis, you're right, that would work.

But the value is this:
, these (not enough, nope, never),
...not this...
, (these not enough, nope, never),

Text::CSV_XS chokes if you replace the parens with your tr/// suggestion. CSV requires that either the whole field or none of the field be quoted - you can't quote part of a field.

  • Comment on Re: Re: Re: Splitting a comma-delimited string where a substring could countain commas

Replies are listed 'Best First'.
Re4: Splitting a comma-delimited string where a substring could countain commas
by belg4mit (Prior) on May 05, 2002 at 01:18 UTC
    Good call. A little massaging would overcome that, but then that puts us in the realm of s/// and others have already posted better solutions using that.

    --
    perl -pew "s/\b;([mnst])/'$1/g"