Add date and timestamp to a o/p file generated in a folder

Highlighted
mahak_jain01
Level 1
Add date and timestamp to a o/p file generated in a folder
Hi Team,

We have a workflow where data from o/p table has to moved to a shared drive folder on daily basis. Requirement is to append a datetime to the end of the file name, so that it does not overrides the previous run file.

Ex- Say the file name to be created in shared folder is: Loan_Rate

so, now going forward it should be named as : Loan_Rate_2018-11-28,Loan_Rate_2018-11-29 for daily run



Can anyone please help me how to solve this with the help of python code.

I tried but its failing.



Thanks,

Mahak
0 Kudos
1 Reply
Alex_Combessie Dataiker
Dataiker
Re: Add date and timestamp to a o/p file generated in a folder
Hi,

This is a typical use case for file-based partitioning: https://doc.dataiku.com/dss/latest/partitions/fs_datasets.html

If you have never tried partitioning before, I would suggest following our tutorial first (it has examples in Python): https://www.dataiku.com/learn/guide/free-training/partitioning.html

Hope it helps,

Alex
0 Kudos
Labels (3)