Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to see how I could achieve 2 things.
1. Search and replace a string with blank for everything inside brackets including the brackets. e.g.
original text: articulate the interaction of ecology with human society, including policy and legal frameworks for management of biological resources (K, A, E, I)
New Text: articulate the interaction of ecology with human society, including policy and legal frameworks for management of biological resources
2. With that text inside the brackets, get it and put it into a new field. This time not including brackets.
original
Field 1 Field 2
werwerwr (K,A,E,I)
original
Field 1 Field 2
werwerwr K,A,E,I
Thanks in advance
Hi,
Please refer the screen shot below for job output.
The transformations to be used are as below
For string first part -> row1.input_data.substring(0,row1.input_data.indexOf("(")) For string second part -> row1.input_data.substring(row1.input_data.indexOf("(")+1,row1.input_data.indexOf(")"))
If the answer has helped you, could you please mark the topic as resolved? Kudos are also welcome 🙂
Warm Regards,
Nikhil Thampi
Hi,
Please refer the screen shot below for job output.
The transformations to be used are as below
For string first part -> row1.input_data.substring(0,row1.input_data.indexOf("(")) For string second part -> row1.input_data.substring(row1.input_data.indexOf("(")+1,row1.input_data.indexOf(")"))
If the answer has helped you, could you please mark the topic as resolved? Kudos are also welcome 🙂
Warm Regards,
Nikhil Thampi
Thanks Nikhil Thampi, worked a treat.
Thanks buddy, my requirement similar to this, except having some more conditions like below.
1) 6 fields separated by Pipe("|").
2) If the 5th field has values "R", then only 6 field is like "[123:11:xyz:00]", otherwise not.
Now, I need to first filter records using the above condition, which I am performing in tmap and separating the required 6 field after removing brackets, but now I want to separate this field(123:11:xyz:00) in the same tmap component having ":" separator and assign values to field1,field2,field3,field4 e.g. field1 would be 123, field2 would be 11, field3 would be xyz and field4 would be 00 and here I am stucking, can someone suggest on how to proceed on this. I only want to use one component( I think tmap should do the task).
I am new to Talend, earlier I was calculating this value in reformat component in ab initio after declaring variable and fetching the fields in vectors.
Thanks in advance.
hi @nthampi
if my input_data has a combination of values with parenthesis and without parenthesis, can you please provide what the command should be? for example, my input_data may contain the following:
1. abcdef (123)
2. hijklmn
3. wxyz (wxyz) (456)
i would want my output to be:
field1 field2
1. abcdef 123
2. hijlkmn
3. wxyz (wxyz) 456