Four Stars

Blank value handling in tmap

Hi Team ,
In my source input file I have null and blank value which I need to populate in separate file .
For Null I have implemented below logic , but do not know how do I handle blank values ..Please help me with logic
row2.aaa==null|| row3.bbb==null
6 REPLIES
Fifteen Stars

Re: Blank value handling in tmap

You have nulls handled. Do you mean empty Strings ("")? If so, you need to check like this....
row2.aaa==null||row2.aaa.trim().compareToIgnoreCase("")==0|| row2.bbb==null||row2.bbb.trim().compareToIgnoreCase("")==0

First you need to check for null for your object, then check for an empty String. The "trim()" is there to remove spaces (if spaces are OK, you will need to remove that section), the "compareToIgnoreCase()" is used to compare the value to "" (an empty String).
Rilhia Solutions
Four Stars

Re: Blank value handling in tmap

IH team ,
Please look the screen shot below values
Arow   Brow
add1   end2
null    end3
         deie
ww                      

Few values ==null
Few values==empty (with outspace)
few values== with space ...
I need to capture .. no data but .. there is space. (similar to null buut with space only)
Can u please tell me how can I do this
Fifteen Stars

Re: Blank value handling in tmap

I am not sure what you want. The solution I added above will help you capture null, " ", "      ", and "". The only thing you will need to refine is the logic. The above code will accept all of those values. If you want to filter them out, you will need to use  NOTs and ANDs.
Rilhia Solutions
Four Stars

Re: Blank value handling in tmap

Above solution is not working it says invalid , my question is very simple I need to handle string which has length , but no value ( string with blank )
Fifteen Stars

Re: Blank value handling in tmap

The solution will work, but maybe your implementation of it has errors. It is easier if you post exactly what you are doing (ie post your code) then we can tell you what is wrong.
Rilhia Solutions
Fifteen Stars

Re: Blank value handling in tmap

Also can you give the exact error message and datatypes involved?
Rilhia Solutions