Skip to main content

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 esplit2] with the value A

I've tried AttributeSplitter;AttributeTrimmer;AttributeCreator

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.


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

 

 


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:


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!

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.

 

 


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.

 

 


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.

 

 

 


Reply