thotwielder
thotwielder

Reputation: 1707

pentaho data integration dynamic file name

New to PDI here. Need to output data from a view in a postgresql database to a file daily. The output file will be like xxxx_20160427.txt, so need to append the dynamic date in the file name. How to do it?

EDIT-----------------

I was not clear here by asking how to add dynamic date, I was trying to add not just date but optional other parts to the file name. E.g adding a serial no (01) at the end: xxxx_2016042701.txt etc. So my real question is how to make a dynamic file name? In other ETL tool e.g. SSIS it will be a simple expression. Not sure how it is done in PDI?

Upvotes: 1

Views: 9060

Answers (2)

Otto
Otto

Reputation: 3294

You can create a dynamic filename variable with a Modified Java Script value STEP.

enter image description here

and then in the Text File Output STEP click on "Accept file name from field", and select your variable declared from previous step (filename_var on this example).

enter image description here

Upvotes: 2

Brian.D.Myers
Brian.D.Myers

Reputation: 2518

In your Text file output step, simply check "Include date in filename?" under the files tab.

Upvotes: 3

Related Questions