Catch the line Number that's being processed from fileinput in tMAP

One Star

Catch the line Number that's being processed from fileinput in tMAP

Hi Smiley Happy

It's possible the tMap catch the line number that it's being processed? My goal is to inform which lines of the file dosn't meet the constraints ...
(see image in attach)

Thanks in advance Smiley Happy
Employee

Re: Catch the line Number that's being processed from fileinput in tMAP

$nb_line_tFileInputDelimited_1 should be fine :-)
One Star

Re: Catch the line Number that's being processed from fileinput in tMAP

I have a similar problem (but with Java).
I have a tFileInputDelimited followed by a tMap (connected by a Main connection).
Within the tMap I need to catch the current line number of the tFileInputDelimited.
I used:
((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE"))
but it crashes at runtime with a Null Pointer Exception.
I think this is because the NB_LINE is defined "after" the tFileInputDelimited input loop and not "during" the loop.
Someone can tell me if it's possible to catch the current line number during the loop?
Highlighted
One Star

Re: Catch the line Number that's being processed from fileinput in tMAP

Hi,
you could add a line number with Numeric.sequence to your stream (in a tMap for example).
Bye
Volker

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 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog