Date in export file name

Tim_20906
Tim_20906 Altair Community Member
edited February 2020 in Community Q&A
I have several files being exported via Monarch 15 and Automator where I am appending the current date to the file name in the export settings as follows:

\\server\path\filename_&[mm]&[dd]&[yyyy].ext

I now have a need to export with a different date, mostly as <current date> + 1.

I can do this with a post-process script, but would prefer to define it in the Monarch/Automator project.  Does anyone know a way that this can be done?

------------------------------
Tim Schrupp
Enterprise BI Developer
------------------------------
Tagged:

Answers

  • Baba_Majekodunmi_703
    Baba_Majekodunmi_703
    Altair Employee
    edited February 2020
    Hi @Tim Schrupp!

    Impressive stuff. I'm not sure that you can define dynamic export naming convention at all within a Model or Project, at least with regards to desktop. As you know this is available in Automator. Is the automator process not working as intended? Or is it longer/require more steps than you would prefer?

    @Mahmoud Abdolrahim and @Steve Caiels, who do you gentlemen think?


    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 02-26-2020 11:58 AM
    From: Tim Schrupp
    Subject: Date in export file name

    I have several files being exported via Monarch 15 and Automator where I am appending the current date to the file name in the export settings as follows:

    \\server\path\filename_&[mm]&[dd]&[yyyy].ext

    I now have a need to export with a different date, mostly as <current date> + 1.

    I can do this with a post-process script, but would prefer to define it in the Monarch/Automator project.  Does anyone know a way that this can be done?

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    "
  • Tim_20906
    Tim_20906 Altair Community Member
    edited February 2020

    Hi @Tim Schrupp!

    Impressive stuff. I'm not sure that you can define dynamic export naming convention at all within a Model or Project, at least with regards to desktop. As you know this is available in Automator. Is the automator process not working as intended? Or is it longer/require more steps than you would prefer?

    @Mahmoud Abdolrahim and @Steve Caiels, who do you gentlemen think?


    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 02-26-2020 11:58 AM
    From: Tim Schrupp
    Subject: Date in export file name

    I have several files being exported via Monarch 15 and Automator where I am appending the current date to the file name in the export settings as follows:

    \\server\path\filename_&[mm]&[dd]&[yyyy].ext

    I now have a need to export with a different date, mostly as <current date> + 1.

    I can do this with a post-process script, but would prefer to define it in the Monarch/Automator project.  Does anyone know a way that this can be done?

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    "

    That notation to append current date to filenames has been working great in both Automator and desktop.  However, I need to export files with the date as current date + 1, and haven't seen any way to do that.  The export will be created as an Automator process, so it shouldn't matter whether it will work in a desktop project.

    Example, a file exported today would be created as Filename_02262020.txt, and I need to export to Filename_02272020.txt.

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 02-26-2020 02:39 PM
    From: Baba Majekodunmi
    Subject: Date in export file name

    Hi @Tim Schrupp!

    Impressive stuff. I'm not sure that you can define dynamic export naming convention at all within a Model or Project, at least with regards to desktop. As you know this is available in Automator. Is the automator process not working as intended? Or is it longer/require more steps than you would prefer?

    @Mahmoud Abdolrahim and @Steve Caiels, who do you gentlemen think?


    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325
    ------------------------------

    Original Message:
    Sent: 02-26-2020 11:58 AM
    From: Tim Schrupp
    Subject: Date in export file name

    I have several files being exported via Monarch 15 and Automator where I am appending the current date to the file name in the export settings as follows:

    \\server\path\filename_&[mm]&[dd]&[yyyy].ext

    I now have a need to export with a different date, mostly as <current date> + 1.

    I can do this with a post-process script, but would prefer to define it in the Monarch/Automator project.  Does anyone know a way that this can be done?

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    "
  • Baba_Majekodunmi_703
    Baba_Majekodunmi_703
    Altair Employee
    edited February 2020
    Tim_20906 said:

    That notation to append current date to filenames has been working great in both Automator and desktop.  However, I need to export files with the date as current date + 1, and haven't seen any way to do that.  The export will be created as an Automator process, so it shouldn't matter whether it will work in a desktop project.

    Example, a file exported today would be created as Filename_02262020.txt, and I need to export to Filename_02272020.txt.

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 02-26-2020 02:39 PM
    From: Baba Majekodunmi
    Subject: Date in export file name

    Hi @Tim Schrupp!

    Impressive stuff. I'm not sure that you can define dynamic export naming convention at all within a Model or Project, at least with regards to desktop. As you know this is available in Automator. Is the automator process not working as intended? Or is it longer/require more steps than you would prefer?

    @Mahmoud Abdolrahim and @Steve Caiels, who do you gentlemen think?


    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325
    ------------------------------

    Original Message:
    Sent: 02-26-2020 11:58 AM
    From: Tim Schrupp
    Subject: Date in export file name

    I have several files being exported via Monarch 15 and Automator where I am appending the current date to the file name in the export settings as follows:

    \\server\path\filename_&[mm]&[dd]&[yyyy].ext

    I now have a need to export with a different date, mostly as <current date> + 1.

    I can do this with a post-process script, but would prefer to define it in the Monarch/Automator project.  Does anyone know a way that this can be done?

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    "

    Okay, I will defer to @Mahmoud Abdolrahim and @Steve Caiels on this. I normally use the naming macros available within Automator and/or feed the exports to a database (Access or SQL).

    Sometimes I also use the distribution node to move all processed files to a folder and have them renamed. But I see the value in your method too.

    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 02-26-2020 03:33 PM
    From: Tim Schrupp
    Subject: Date in export file name

    That notation to append current date to filenames has been working great in both Automator and desktop.  However, I need to export files with the date as current date + 1, and haven't seen any way to do that.  The export will be created as an Automator process, so it shouldn't matter whether it will work in a desktop project.

    Example, a file exported today would be created as Filename_02262020.txt, and I need to export to Filename_02272020.txt.

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------

    Original Message:
    Sent: 02-26-2020 02:39 PM
    From: Baba Majekodunmi
    Subject: Date in export file name

    Hi @Tim Schrupp!

    Impressive stuff. I'm not sure that you can define dynamic export naming convention at all within a Model or Project, at least with regards to desktop. As you know this is available in Automator. Is the automator process not working as intended? Or is it longer/require more steps than you would prefer?

    @Mahmoud Abdolrahim and @Steve Caiels, who do you gentlemen think?


    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325

    Original Message:
    Sent: 02-26-2020 11:58 AM
    From: Tim Schrupp
    Subject: Date in export file name

    I have several files being exported via Monarch 15 and Automator where I am appending the current date to the file name in the export settings as follows:

    \\server\path\filename_&[mm]&[dd]&[yyyy].ext

    I now have a need to export with a different date, mostly as <current date> + 1.

    I can do this with a post-process script, but would prefer to define it in the Monarch/Automator project.  Does anyone know a way that this can be done?

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    "
  • Mahmoud
    Mahmoud
    Altair Employee
    edited February 2020

    Okay, I will defer to @Mahmoud Abdolrahim and @Steve Caiels on this. I normally use the naming macros available within Automator and/or feed the exports to a database (Access or SQL).

    Sometimes I also use the distribution node to move all processed files to a folder and have them renamed. But I see the value in your method too.

    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 02-26-2020 03:33 PM
    From: Tim Schrupp
    Subject: Date in export file name

    That notation to append current date to filenames has been working great in both Automator and desktop.  However, I need to export files with the date as current date + 1, and haven't seen any way to do that.  The export will be created as an Automator process, so it shouldn't matter whether it will work in a desktop project.

    Example, a file exported today would be created as Filename_02262020.txt, and I need to export to Filename_02272020.txt.

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------

    Original Message:
    Sent: 02-26-2020 02:39 PM
    From: Baba Majekodunmi
    Subject: Date in export file name

    Hi @Tim Schrupp!

    Impressive stuff. I'm not sure that you can define dynamic export naming convention at all within a Model or Project, at least with regards to desktop. As you know this is available in Automator. Is the automator process not working as intended? Or is it longer/require more steps than you would prefer?

    @Mahmoud Abdolrahim and @Steve Caiels, who do you gentlemen think?


    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325

    Original Message:
    Sent: 02-26-2020 11:58 AM
    From: Tim Schrupp
    Subject: Date in export file name

    I have several files being exported via Monarch 15 and Automator where I am appending the current date to the file name in the export settings as follows:

    \\server\path\filename_&[mm]&[dd]&[yyyy].ext

    I now have a need to export with a different date, mostly as <current date> + 1.

    I can do this with a post-process script, but would prefer to define it in the Monarch/Automator project.  Does anyone know a way that this can be done?

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    "

    To assign previous day macro use the following syntax:
    previous day: &[yy]&[mm]&[dd.-1d]
    Previous month: &[yy]&[mm.-1m]&[dd]
    Previous year: &[yy.-1y]&[mm]&[dd]

    replace minus sign with plus sign for future date: previous day: &[yy]&[mm]&[dd.+1d]

    When month changes, the syntax should be &[yy]&[mm.-1m]&[dd.-1d]
    When year changes, the syntax should be &[yy.-1y]&[mm.-1m]&[dd.-1d]

    demo1_&[yyyy.-1y]&[mm.-1m]&[dd.-1d].xlsx  (if date is 09/16/2019 the file name will be: demo1_20180816.xlsx)
    demo1_&[yyyy]&[mm.-3m]&[dd].xlsx (if date is 09/16/2019 the file name will be: demo1_20190617.xlsx)
    Regards
    Mo

    ------------------------------
    Mahmoud Abdolrahim
    Senior Implementation & Integration Engineer
    Datawatch Corporation
    MA
    (978) 935-3840
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 02-26-2020 03:52 PM
    From: Baba Majekodunmi
    Subject: Date in export file name

    Okay, I will defer to @Mahmoud Abdolrahim and @Steve Caiels on this. I normally use the naming macros available within Automator and/or feed the exports to a database (Access or SQL).

    Sometimes I also use the distribution node to move all processed files to a folder and have them renamed. But I see the value in your method too.

    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325
    ------------------------------

    Original Message:
    Sent: 02-26-2020 03:33 PM
    From: Tim Schrupp
    Subject: Date in export file name

    That notation to append current date to filenames has been working great in both Automator and desktop.  However, I need to export files with the date as current date + 1, and haven't seen any way to do that.  The export will be created as an Automator process, so it shouldn't matter whether it will work in a desktop project.

    Example, a file exported today would be created as Filename_02262020.txt, and I need to export to Filename_02272020.txt.

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer

    Original Message:
    Sent: 02-26-2020 02:39 PM
    From: Baba Majekodunmi
    Subject: Date in export file name

    Hi @Tim Schrupp!

    Impressive stuff. I'm not sure that you can define dynamic export naming convention at all within a Model or Project, at least with regards to desktop. As you know this is available in Automator. Is the automator process not working as intended? Or is it longer/require more steps than you would prefer?

    @Mahmoud Abdolrahim and @Steve Caiels, who do you gentlemen think?


    ------------------------------
    Baba Majekodunmi
    Solutions Consultant
    Altair Engineering Inc.
    Manassas VA
    978-275-9325

    Original Message:
    Sent: 02-26-2020 11:58 AM
    From: Tim Schrupp
    Subject: Date in export file name

    I have several files being exported via Monarch 15 and Automator where I am appending the current date to the file name in the export settings as follows:

    \\server\path\filename_&[mm]&[dd]&[yyyy].ext

    I now have a need to export with a different date, mostly as <current date> + 1.

    I can do this with a post-process script, but would prefer to define it in the Monarch/Automator project.  Does anyone know a way that this can be done?

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    "
  • Steve_Caiels
    Steve_Caiels
    Altair Employee
    edited February 2020
    Hi Tim,

    The newer versions of Automator have an additional Macro called 'Date Format' that will cope with wrapping into new months and years.  
    For example, with today being the 27th Feb, 2020 (a leap year), the macro below with a +3d, returns 1st March, 2020.  You can swap the yyyyMMdd into your desired format.
    If you don't see it in the naming macro drop down, then I'm afraid you will need to upgrade your Automator to get this feature.

    Regards,
    Steve.
    image


    ------------------------------
    Steve Caiels
    Professional Services
    Altair
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 02-26-2020 11:58 AM
    From: Tim Schrupp
    Subject: Date in export file name

    I have several files being exported via Monarch 15 and Automator where I am appending the current date to the file name in the export settings as follows:

    \\server\path\filename_&[mm]&[dd]&[yyyy].ext

    I now have a need to export with a different date, mostly as <current date> + 1.

    I can do this with a post-process script, but would prefer to define it in the Monarch/Automator project.  Does anyone know a way that this can be done?

    ------------------------------
    Tim Schrupp
    Enterprise BI Developer
    ------------------------------
    "