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
Highlighted
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
Highlighted
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
Four Stars

Re: Extract X rows of a csv file

hehe it works !

Thank you !

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download