javamysqltalendsoundex

Talend: get SOUNDEX of String in tMap


I am inserting data from a CSV file to a MySQL database, and one of the columns should contain the SOUNDEX representation of a string.

For example, I have the first name as a column in the CSV and the database should contain its SOUNDEX.

I am using tMap between the file delimited and MySQL output, so the operation should be there. Something like SOUNDEX(row1.FIRST_NAME).

Details: Talend Open Studio, MySQL database


Solution

  • You can use Apache Commons Codec to do this. First load the library using tLibraryLoad:
    enter image description here

    Then use:

    new org.apache.commons.codec.language.Soundex().encode("<string>")