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 !

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

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now