Question

Split attribute values into a list of values


Badge

Hello,

I'm trying to split a value in an attribute into a list of values:

e.g. Attribute colour has value "red; blue" and I want to split the value by ";" to a list "colour_list{}.colour"

Any ideas? Thanks, Moni


4 replies

Userlevel 2
Badge +16

AttributeSplitter is your transformer!

Badge

Hello,

I'm not so sure this transformer is any good. Reason being I don't want to end up with attributes Colour1 (=red), Colour2 (=blue), ... The help page for this transformer suggests that would happen (single line address being split into street, postcode, town...)

In my case, I need one single attribute Colour with a list of values.

Userlevel 2
Badge +16

@honkovam That is exactly what the transformer does: create a list from the values using the separator. See attached images:

Badge +22

The AttributeSplitter as @erik_jan says is the transformer you want to use. It creates a simple list.

 

_list{0} = red

 

_list{1} = blue

If however you want a complex list as in your question example, then you would need to use the BulkAttributeRenamer to rename the list as the ListRenamer does not allow for simple list to complex list (though it does the inverse).

 

Reply