As an alternative to the other suggestions you could use a REXX stage:
'| REXX KWSPLIT',
The KWSPLIT REXX file contains:
/* REXX stage to split at keywords */
signal on error
DO FOREVER
'READTO RECORD'
DO WHILE length(record)>0
parse var record var_name '=' remaining
IF left(remaining,1)='('
THEN DO
parse var remaining data '),' record
data=data')'
END
ELSE parse var remaining data ',' record
'OUTPUT' var_name'='data','
END
END
error: exit RC*(RC^=12)
Brian Nielsen
On Tue, 28 Nov 2006 09:12:20 -0600, Huegel, Thomas <[EMAIL PROTECTED]>
wrote:
>This list has the smartest guys around, so I have another PIPE how to.
>
>I have an input that looks like this:
>
>aaa=apple,bbb=ball,ccc=(cat,cow,candle),ddd=dog
>
>What I want is an output stem that looks like this:
>aaa=apple,
>bbb=ball,
>ccc=(cat,cow,candle),
>ddd=dog
>
>The input fields may be in any order and any (or none) may be inside
>parents.
>The trick is to be able to ignore the commas inside the parents.
>
>At first it looked easy just using SPLIT but I can't figure out how to
>handle the (cat,cow,candle) as one entity.
>
>Can anyone help?
>
>Tom
>
>
>
>__________________________________________________________________
><< ella for Spam Control >> has removed VSE-List messages and set aside
>VM-List for me
>You can use it too - and it's FREE! http://www.ellaforspam.com
>