• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Handling "null" and “” or ‘’ or ‘ values.

#1 2009-08-10 16:33:45

Mani
Member
Registered: 2009-05-12
Posts: 23

Handling "null" and “” or ‘’ or ‘ values.

Hi,

I have used a input field (String) and wants to validate the field
in Tmap component -  (Java project)

How to validate and replace the value 0 if null or “” or ‘’ or ‘ values comes for that particular field in input.

Please let me know your pointers and updates.

Using the below expression i can able to check the null condition alone but not the
“” or ‘’ or ‘ values in input

row1.T_amount  == null? "0" : row1.T_amount;

Thanks and regards,
Manikandan.R


Thanks and Regards,
Mani.

Offline

#2 2009-08-11 08:41:50

shong
Talend team
Registered: 2007-08-29
Posts: 10350
Website

Re: Handling "null" and “” or ‘’ or ‘ values.

Hello guy
try

Code:

row1.T_amount.equals("\"\"")? "0" : row1.T_amount    //for ""

Code:

row1.T_amount.equals("\'\'")? "0" : row1.T_amount    //for ''

Code:

row1.T_amount.equals("\'")? "0" : row1.T_amount    //for '

Best regards

         shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2009-08-11 14:34:43

Mani
Member
Registered: 2009-05-12
Posts: 23

Re: Handling "null" and “” or ‘’ or ‘ values.

The above solutions leads to Java error.
Please let me know if any other ways to handle the special charecters.

Thanks and Regards,
Mani.


Thanks and Regards,
Mani.

Offline

#4 2009-08-11 15:57:35

shong
Talend team
Registered: 2007-08-29
Posts: 10350
Website

Re: Handling "null" and “” or ‘’ or ‘ values.

Hello
What's the java error message?

Can you show us your source file?

Best regards

          shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Handling "null" and “” or ‘’ or ‘ values.

Board footer

Powered by FluxBB