Skip to main content

Hello, i have a problem with the stringconcatenator. i would like to combine several values of text attributes with the stringconcatenator as a new attribute. the values should be separated by a comma, empty attributes should be ignored and there must be no comma at the end. how can this be achieved? I always get two or more comms if the attribute is emtpy. Thanks a lot.

You can follow the StringConcatentor with two StringReplacers:

One using the following regex, replacing with a single comma.

,{2,}

The second StringReplacer will replace any remaining comma at the end with blank string using

,$

 

Alternatively, you can do this in a single AttributeCreator using the following string:

@ReplaceRegularExpression(@ReplaceRegularExpression(@Value(att),",{2,}",",",caseSensitive=TRUE),",$","",caseSensitive=TRUE)

Perfect, that works great for me. 😃

Thanks  !


Reply