Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Labels (3)
12 Replies
janhess
Creator II
Creator II

What is the real format of the data? Is it a text file with delimited fields?
Anonymous
Not applicable
Author

The file is in a comma delimited format, but my question is regarding 1 field. The contact names are usually (lastname, firstname), but i want to manipulate the field using tmap properties when i map the fields to the output table in format of (firstname lastname).
janhess
Creator II
Creator II

Define the columns in a tFileInputDelimited. Use this for the input to the tMap and in the output field have the rule first + " " + last
Anonymous
Not applicable
Author

This will not help to solve the problem i am having in switching the names around, because they come in the same field and they space delimited. Do you know if there is an equivalent command in Java/Talend for the "FIND" and "SEARCH" commands in Microsoft Excel?" Thanks!
Anonymous
Not applicable
Author

Can anyone help me with the expression to parse or split a field(CONTACT) in a table in the tMap environment and to join said field back together in the correct format? (the input file is tab-delimited)
Example: LASTNAME FIRSTNAME (the names have about 4 spaces between them)
Brown John
Smith Mike
Correct Formant: John Brown
Mike Smith

Thanks!
janhess
Creator II
Creator II

Look for Java string functions on Google.
or you can use Talend string handling functions such as StringHandling.LEFT(row2.mailbox, row2.mailbox.indexOf("@")) to get the name from an email address. Use LEN and RIGHT to get the part after the "@".
or you could use tExtractDelimitedFields on the field.
Anonymous
Not applicable
Author

This doesnt work on my project
Win7 64bit
StringHandling.LEFT(row2.mailbox, row2.mailbox.indexOf("@"))
janhess
Creator II
Creator II

Why not?
_AnonymousUser
Specialist III
Specialist III

Look for Java string functions on Google.
or you can use Talend string handling functions such as StringHandling.LEFT(row2.mailbox, row2.mailbox.indexOf("@")) to get the name from an email address. Use LEN and RIGHT to get the part after the "@".
or you could use tExtractDelimitedFields on the field.