Add date and timestamp to a o/p file generated in a folder
![mahak_jain01](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar5.png)
mahak_jain01
Registered Posts: 2 ✭✭✭✭
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
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
Tagged:
Answers
-
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