Skip to main content

here i need to separate QD and after values into another field. How to separate them

venkat QD 33245saleem QD 360sreelatha QD 420sai QD 123

 

 

above table converted into below table

 

NameBlockvenkatQD 33245saleemQD 360sreelathaQD 420saiQD 123

 

You do this with an AttributeCreator with two rows:

New Attribute: Name Attribute Value: @Substring(@Value(YourFieldName),0,@FindRegEx(@Value(YourFieldName),QD))

New Attribute: Block Attribute Value: @Substring(@Value(YourFieldName),@FindRegEx(@Value(YourFieldName),QD))


Hi @tomjerry.vl,

If you're not too familiar with using string functions you can also do this with a series of String transformers:

1. StringSearcher - use regex to find the string that matches QD to end of string and create the new Block attribute from this.

2. StringReplacer - use the same regex and replace with nothing to get just the Name.

An example workspace is attached: none2none.fmw


This is another option:

Use AttributeSplitter (separator is a space) and store parts in a list.

Then use an AttibuteCreator to create:

Name = _list{0}

Block = _list{1} _llst{2}

This works as long as the Name contains no spaces.


Hello,

To do this, I would use an Attributesplitter, setting it so that the "Deliver or Format string" is QD and allow it to trim white space. It will create a list that I would then explode an test by the _element_index (either 0, thus rename attribute column 1, or 1 and then with a string concatenator add "QD " before the number).

I would then use a Feature merger to put together the différent elements. Eitzher, you merge using the complete line or, to do it faster by using number instead of text, you can put a counter before the attribute splitter and use this parameter.

I tried this using a text file but maybe with your input data you have already such a parameter.

Hope this help

V.

 


Reply