cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Append Today's Date to the CSV file

skodali
New Contributor III

Hi,

Iโ€™m trying to write a CSV file with Date.now() at the end of file name. But Iโ€™m not able to see the file in destination folder If I have date.now in the expression[โ€œsftp://zing.grouponinc.net/Workday/Completed/workday_integrationโ€ + Date.now() +โ€œ.csvโ€]. I can see the new file creating in the destination folder if the expression doesnโ€™t have date.now()[โ€œsftp://zing.grouponinc.net/Workday/Completed/workday_integration.csvโ€].
Can anyone help me in this why itโ€™s not showing?
WOR NOT

1 ACCEPTED SOLUTION

tlikarish
Employee
Employee

Are you seeing any error messages when you run the pipeline? If not, this seems like there may be a bug that needs to get fixed.

The Date.now() function will write out the local date and time in the format YYYY-MM-DDTHH:mm:ss.SSS. Sometimes colon characters are not allowed in file names, so maybe itโ€™s that? You could try changing the expression to

โ€œsftp://zing.grouponinc.net/Workday/Completed/workday_integrationโ€ + Date.now().toString().replaceAll(":", "_") + ".csv"

Or something similar and try to see if that works.

View solution in original post

3 REPLIES 3

tlikarish
Employee
Employee

Are you seeing any error messages when you run the pipeline? If not, this seems like there may be a bug that needs to get fixed.

The Date.now() function will write out the local date and time in the format YYYY-MM-DDTHH:mm:ss.SSS. Sometimes colon characters are not allowed in file names, so maybe itโ€™s that? You could try changing the expression to

โ€œsftp://zing.grouponinc.net/Workday/Completed/workday_integrationโ€ + Date.now().toString().replaceAll(":", "_") + ".csv"

Or something similar and try to see if that works.

skodali
New Contributor III

Thank you @tlikarish

Itโ€™s because of the column. By replacing colon has fixed the issue.

Hi skodali,

i have encountered same error , i have resolved it by adding this file name in s3 writer

โ€œs3:///bucket@s3.region.amazonaws.com/outfile1_โ€ + Date.now() + โ€œ.csvโ€

Regards,
Mangesh