create output file with rolling file name

One Star

create output file with rolling file name

Hi ,
I need to create a job which will create a new output file(rolling file name) for every time I run the job. some thing like
out_001.xml
out_002.xml
out_003.xml
do you have any idea to achieve this using Talend?
Thanks in advance.

Re: create output file with rolling file name

keep a count on a DB/file for this job
so everytime, job starts you read this value and set it in a variable (used in the output file)
good?
Seven Stars

Re: create output file with rolling file name

Or you can use tFileList --> IterateToFlow --> tMap (to parse file numbers) --> tAggregateRow (to find the max) --> tSetGlobalVar and then use the global variable in your file name.
One Star

Re: create output file with rolling file name

Or you can use tFileList --> IterateToFlow --> tMap (to parse file numbers) --> tAggregateRow (to find the max) --> tSetGlobalVar and then use the global variable in your file name.

can you discuss the process in more details , like select bla bla from bla bla then connect to bla bla ..
thx
Seven Stars

Re: create output file with rolling file name

See screenprint
Highlighted
One Star

Re: create output file with rolling file name

thanks alevy.. I tried another way..
One Star

Re: create output file with rolling file name

thx alevy
@ashu : will you please discuss your way here too ..
One Star

Re: create output file with rolling file name

I have one approach where I appended date and time in outputfile like dd-mm-yyyy_hh_MM_ss
One Star

Re: create output file with rolling file name

it was so simple.. I just created a table with one row.. two columns.. FileName and Sequence... i will be querying that table to get the filename and sequence number.. after that increment the sequence number..
here I'm attaching my job but its different from what I explained.. in tjavarow I'm doin some condition checks...

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.