Skip to main content
Question

Split attribute values into a list of values


Forum|alt.badge.img

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

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • July 6, 2016

AttributeSplitter is your transformer!


Forum|alt.badge.img
  • Author
  • July 6, 2016

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.


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • July 6, 2016

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


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • July 11, 2016

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).

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings