[resolved] Extract sample rows from delimited input file

One Star

[resolved] Extract sample rows from delimited input file

Hello
From one delimited input file (csv with X rows) I would like to extract a sample file with one row out of each 200.
Is there a component that will let me do this ?
If so, I think i'll have to get the number of line from input file with globalvar NBLINE, and add a modulus 200 (%200)
Thanks a lot. 

Accepted Solutions
Five Stars

Re: [resolved] Extract sample rows from delimited input file

Do you need random rows then use Advance Setting--> "Extract Line at Random" 
this can provide you random rows from your input file. use limit option to control the number of lines needed. 

All Replies
Moderator

Re: [resolved] Extract sample rows from delimited input file

Hi fbonnot,

Do you want to extract the first 200 rows or any 200 rows in input file? If former, you can use "Header", "Footer" and "Limit" option in tfileinputdelimited component to control the number of lines needed. 
If you want to extract any 200 rows in your input file, could you please take a look at a related forum: https://www.talendforge.org/forum/viewtopic.php?id=37576 to see if it is what you are looking for?

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: [resolved] Extract sample rows from delimited input file

Do you need random rows then use Advance Setting--> "Extract Line at Random" 
this can provide you random rows from your input file. use limit option to control the number of lines needed. 
One Star

Re: [resolved] Extract sample rows from delimited input file

Hi
Thank you very much for your answers.
I needed a random output so I'll use the built in feature of the fileinputdelimited componant (lazy me ! could have found it alone)
Bye