Skip to main content
Solved

Split attributevalue into 2 different attributes

  • September 20, 2017
  • 7 replies
  • 1134 views

Forum|alt.badge.img

I have an attribute [complete] withe the value 1-A.

 

I would like to split that value to attribute [split1] with the value 1

 

and attribute [split2] with the value A

I've tried AttributeSplitter;AttributeTrimmer;AttributeCreator

Best answer by courtney_m

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.

View original
Did this help you find an answer to your question?

7 replies

courtney_m
Contributor
Forum|alt.badge.img+12
  • Contributor
  • Best Answer
  • September 20, 2017

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • September 20, 2017
courtney_m wrote:

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.

Or follow the AttributeSplitter by an AttributeCreator to create [split1] with value _list{0} and [split2] with value _list{1}.

 

 


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • September 20, 2017

Hi @kees_v, you can accomplish this using the AttributeManager as well. If you're splitting by only one character on each side of the -, you can set the transformer parameters as they are below:


courtney_m
Contributor
Forum|alt.badge.img+12
  • Contributor
  • September 20, 2017
erik_jan wrote:
Or follow the AttributeSplitter by an AttributeCreator to create [split1] with value _list{0} and [split2] with value _list{1}.

 

 

Yeah, that will work better!

Forum|alt.badge.img
  • Author
  • September 20, 2017
courtney_m wrote:

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.

Thank you, exactly what i needed.

 

 


takashi
Influencer
  • September 21, 2017
courtney_m wrote:

Use an AttributeSplitter with "Attribute to Split" set to complete, and Delimeter set to a dash (-). Then use a ListExploder to on the list attribute created by the splitter. You can then use a FeatureMerger to merge the records back together.

Alternatively, you can also use the AttributeRenamer to rename "_list{0}" to "split1", "_list{1}" to "split2", after splitting the source string with the AttributeSplitter.

 

Anyway, I think the AttributeSplitter would be a general way to split a string by a specific separator character or string.

 

 


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • September 21, 2017
fmelizard wrote:

Hi @kees_v, you can accomplish this using the AttributeManager as well. If you're splitting by only one character on each side of the -, you can set the transformer parameters as they are below:

You can also use the location of the - to determine the input for the substring which will work irrespective of the number of characters either side of the - (as long as there is only a single -)

 

e.g.

 

 

 


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