Extract X rows of a csv file

Four Stars

Extract X rows of a csv file

 

*sorry for my bad english*

Hello,

I compare 2 numbers of lines of 2 different CSV files with tJava componant, it's work.

When it's true, i make an action, and when it's false, i want to extract the number of rows that correspond...

Like this :

- 1st CSV -> 1200 rows

- 2nd CSV -> 1205 rows

I have a globalMap variable with the difference, 5.

 

And i want to extract the 5 last rows of the 2nd CSV file... But i don't know how can i do it...

Anybody know how to do that?

Thanks Smiley Happy


Accepted Solutions
Sixteen Stars TRF
Sixteen Stars

Re: Extract X rows of a csv file

Assume your 1rst file correpsonds to tFileInputDelimited_1, use
((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) to set the head field of your tFileInputDelimited_2 component

TRF

View solution in original post


All Replies
Sixteen Stars TRF
Sixteen Stars

Re: Extract X rows of a csv file

Assume your 1rst file correpsonds to tFileInputDelimited_1, use
((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE")) to set the head field of your tFileInputDelimited_2 component

TRF

View solution in original post

Highlighted
Four Stars

Re: Extract X rows of a csv file

hehe it works !

Thank you !

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