• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] filter on blank field

#1 2009-08-28 01:40:26

PatriciaS
Member
Registered: 2009-08-28
Posts: 12

[resolved] filter on blank field

I have a positional file as input to tMap
I use the Java environment

I am trying to select certain records to an output file.
In the expression filter for the file, I can say
row3.CHECK_NUM.equals("123456789")
and it works

But if I try to select records with the field blank, I get no records selected, even though I have many records with that field blank.

I tried the following, and other more complicated things
row3.CHECK_NUM.equals("         ")

I looked at the file in hex, and the blank field is filled with x20

When I tried to select for non-blank fields, I got all records.

Offline

#2 2009-08-28 04:03:55

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

Re: [resolved] filter on blank field

Hello
try
row3.CHECK_NUM.equals("")

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-28 04:13:06

PatriciaS
Member
Registered: 2009-08-28
Posts: 12

Re: [resolved] filter on blank field

Thank you very much. That worked. It seems weird to this non-Java person :-D

Offline

#4 2012-03-29 15:06:21

caro_vm
Member
Registered: 1970-01-01
Posts: 14

Re: [resolved] filter on blank field

Hello! I have a job like this:

tFileDelimitedInput---->tMap---->tMSSqlOutput

In the file I have an schema like this:

-cuenta (bigdecimal)
-nro_asiento(int)
-fecha(string)
-importe(bigdecimal)
-detalle(string)
-rubro(string)
-ejercicio(string)
cotizacion(bigdecimal)

the schema of the SQLServer is:
-id_cta
-id_tie_dia
-nro_asiento
-imp_asiento
-detalle_asiento
-imping_asiento
-impgas_asiento
-id_tie_ejercicio
-cotizacion_moneda

I have to compare rubro from the CSV file and according to the result of this, fill imping_asiento or impgas_asiento.
The comparison in java code may be:

if (rubro=sad"GAN")){
imping_asiento=importe;
impgas_asiento=0;
}else{
impgas_asiento=importe;
imping_asiento=0;
}

The question is, where I have to put this code? in the tMap component?


Thank you very much
Regards

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] filter on blank field

Board footer

Powered by FluxBB