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
Forteen 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
Forteen 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

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now