Six Stars

tMap - How do you code a NOT EQUAL on a string type column?

I'm still new to Talend Open Studio For Data Integration and have a question on the tMap Expression Builder:
I have a column called row1.Entity_Type_Code which is defined as a string type.
I would like to select rows where the column row1.Entity_Type_Code is NOT Equal to 1.
I've tried:
row1.Entity_Type_Code!="1"
row1.Entity_Type_Code.notequals("1")
How do you code a NOT EQUAL on a string column?
Thanks
2 REPLIES
Seventeen Stars

Re: tMap - How do you code a NOT EQUAL on a string type column?

("1".equals(row1.Entity_Type) == false)

This way your code also not fail if the value is null.
Six Stars

Re: tMap - How do you code a NOT EQUAL on a string type column?

Thanks jlolling that worked!
Perhaps you can help me with this problem:
I have a CVS file with a column that contains a persons full name in all uppercase i.e. STEVE CHARLES SMITH
I would like to edit this column to leave the first letter of each word in uppercase and lowercase the remaining letters of each word so the results look like this: Steve Charles Smith
I tried using the following code in tMap but it only uppercase's the first letter of the first word and the remaining letters are all in lowercase i.e. Steve charles smith
Current Code:
row1.Full_Name.toLowerCase().replaceFirst("",

row1.Full_Name.substring(0,1).toUpperCase())
Does you know how to make the results look like Steve Charles Smith?
Thanks for your time.