how to append a data to the existing csv file that changes its name every time?

Highlighted
Five Stars

how to append a data to the existing csv file that changes its name every time?

Hi,

 

I have a job that loops through and produces a csv file after every 5000 records. The csv file gets its name by the current timestamp("Talend/workspace/stock_"+TalendDate.formatDate("yyyyMMdd_hhmmss",TalendDate.getCurrentDate()) +".csv"). I need to append the data to the same file after every 5000 records until the record limit has reached. 

But, the issue is that it creates a new csv file every time because of the its name which uses current time stamp as its name. If I don't use the current time stamp as a csv file name then it does append the data to the same csv. But its not enogh in my case.

 

Any solutions?

 

Thanks 

Five Stars

Re: how to append a data to the existing csv file that changes its name every time?

Sloution not required anymore. sorted

Nine Stars

Re: how to append a data to the existing csv file that changes its name every time?

Good news! By the way, you can use
TalendDate.getDate("yyyyMMdd_hhmmss")
To get the current date in a given format.

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 3

Read about some useful Context Variable ideas

Blog

Talend Studio Improvements for API Services

Take a look at the Talend Studio improvements for API Services

Watch Now

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