string separation from numerical data

Five Stars

string separation from numerical data

hi,

I have the fields minimum, maximum, average stander-ed_dev, relative_Std_dev...etc. All these fields having string value as well as numerical data i want to print the numerical data in the corresponding fields..

i want to print only 8.08 in minimum field and 8.13 in maximum field and 8.10 in average field...etc like this how do split this data in tmap component.. 

12.png

Thanks & Rehgards

Mastan SHaik

Thirteen Stars

Re: string separation from numerical data

@Mastan_123,

 

1) Since you can extract using tExtractDelimitedFields.

 

https://help.talend.com/reader/QgrwjIQJDI2TJ1pa2caRQA/_MywpLjh6iTB3Orb9afI0w

 

2) in tMap you can use below expersion to get only numuric value.

 

StringHandling.TRIM(row6.Col1.replaceAll("[A-Za-z]","").replaceAll(":","")) 

Manohar B
Highlighted
Six Stars

Re: string separation from numerical data

hi,

below is the expression and expected output

row1.maximum.substring(StringHandling.INDEX(row1.maximum,":")+1,StringHandling.LEN(row1.maximum))

 

Thanks

Venkata Kiran

Five Stars

Re: string separation from numerical data

hi Kiran,

My actual job design is like this..

sample.pngin the second tmap i want to separate the String data from the Numeric data and populate the numeric data in the corresponding field. now i am getting the output as,

12.png

but my actual required output is 

14.png

this is sample data only not exact data the numbers are varied that's why...please give me a solution

 

Thanks & Regards

Mastan  

Thirteen Stars

Re: string separation from numerical data

@Mastan_123 , use below expresion in second tMap.

StringHandling.TRIM(row6.Col1.replaceAll("[A-Za-z]","").replaceAll(":","")) 

Manohar B
Five Stars

Re: string separation from numerical data

Hi Manod,

Thanks for your quick reply,

 

My actual job design is like this..

sample.pngin the second tmap i want to separate the String data from the Numeric data and populate the numeric data in the corresponding field. now i am getting the output as,

12.png

but my actual required output is 

14.png

this is sample data only not exact data the numbers are varied that's why...please give me a solution

 

Thanks & Regards

Mastan  

Thirteen Stars

Re: string separation from numerical data

@Mastan_123, when you have correct input and oput then only the things will better.

 

However you want to take the numeric data from a field,you can use the below expression in the tmap,where you are deriving.

 

StringHandling.TRIM(row6.Col1.replaceAll("[A-Za-z]","").replaceAll(":","")) 

Manohar B
Four Stars

Re: string separation from numerical data

Hi Manod,

 If u have a common separator dividing Num and Alpha fields u can just only use textractdelimited and give separator ':' as seen from your i/p. i have done a sample with input "Minimum: 8.08" in fixedflow having only one field similarly u can do with other fields also and remove excess columns with tfiltercolumns or a tmap.

Capture5.PNG

Five Stars

Re: string separation from numerical data

Hi Manod..

Thanks for your reply i am sending the input file, from this input file you understand my requirement and tell me possible solution.. my output should be..15.pngSample output

check the input file send to you and sample output...

 

Thanks & Regards..

Mastan

Thirteen Stars

Re: string separation from numerical data

@Ameesh,can you check the my first reply for this question? since i proveded both ways.

Manohar B
Four Stars

Re: string separation from numerical data

HI

No offence, just was clarifying and i think this would be suitable for requirement.

Thirteen Stars

Re: string separation from numerical data

still you have this issue?

Manohar B