Forum Discussion

skodali's avatar
skodali
New Contributor III
7 years ago
Solved

Append Today's Date to the CSV file

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?

  • 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.

3 Replies

  • 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's avatar
      skodali
      New Contributor III

      Thank you @tlikarish

      It’s because of the column. By replacing colon has fixed the issue.

      • mangeshj's avatar
        mangeshj
        New Contributor

        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