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

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now

Definitive Guide to Data Quality

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

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads