Talend-Java string manipulation for Find or Search
Wondering how i can go about manipulating a text string in tmap. In Microsoft Excel, i was able to do the following functions:
Source: last, first (the goal is to put it in the proper format without the blank spaces.
A B C D
1 Source Data Field length search for "," Correct Format
2 last, first 21 10 first last
=LEN(A2) =SEARCH(",",A2) =TRIM(RIGHT(A2,LEN(A2)-SEARCH(",",A2))&" "&LEFT(A2,C2-1))
Does anybody have any suggestion on how i can write this formula in the Talend tmap expression? What is the Java string expression for (Find or Search)? Thanks! abbig
Hi Laks, I am not sure right trim is the best way to describe this. Basically, what you want to use is the code below (assuming the row is "row1" and the column is "myValue"....
This uses the Java String "substring" method and "indexOf" method. We find the position in the String of the ":" char with the "indexOf" method, add 1 to it and use that position to start from with the "substring" method.