tMap - tfilterrow and float values

Highlighted
Four Stars

tMap - tfilterrow and float values

Hi,

 

I'm looking for some help about an issue I can't solve. Here's the case :

 

I have a delimited file that looks like this :

Column1,Column2,Column3

Toto, Tata, 59.8

Tito, Tutu, 12.9

,,

,,

 

I want to filter the two last rows (I just want to use the not empty lines).

Things I've tried so far :

- use of a tMap to populate the empty rows and then filter those rows. The column3 is of float type and when I try to check row1.Column3 == 0.0f I get a NullpointerException

- use of a tfilterrow to use only rows that match some condition -> same issue with the float column

- use of the Skip Empty Rows option of tFileInputDelimited but with no success

 

Can you please help me ?

 

Thanks in advance

 


Accepted Solutions
Thirteen Stars

Re: tMap - tfilterrow and float values

solution 1

define this col3 as type string and before tMap use tFilterRow (not equal to "") then convert to float

 

solution 2

in input component deine col3 as NOT NULL and assign default value somewhere outside your range (negative or 0 or huge)

 

it just for start

 

-----------

All Replies
Thirteen Stars

Re: tMap - tfilterrow and float values

solution 1

define this col3 as type string and before tMap use tFilterRow (not equal to "") then convert to float

 

solution 2

in input component deine col3 as NOT NULL and assign default value somewhere outside your range (negative or 0 or huge)

 

it just for start

 

-----------
Four Stars

Re: tMap - tfilterrow and float values

Thank you very much !! Works perfectly Smiley Happy

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.