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
Fifteen Stars TRF
Fifteen 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

All Replies
Fifteen Stars TRF
Fifteen 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
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 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

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch