auto fill today's date into data table nameI need to save as data table to xlsx AND auto adding today's date. For example, file name will be "old name 3/8/2022.xlsx" if I run the script on 3/8/2022, and "old name 3/9/2022.xlsx" if I run the script on 3/9/2022. This is easy to do in SAS, and I assume JMP will be similar. Not sure how to fix the code. thanks
Data Table( "old name" ) << Save( "C:\old name || Today().xlsx" );
Data TablemacOSScriptingRe: auto fill today's date into data table nameThank you! It worked perfectly.
Re: auto fill today's date into data table nameYou need to Format the date:
Format( Today(), "ddMonYYYY" );
Two things to note:
- You don't need Char() since Format() returns a character string.
- Avoid the formats that contain slashes (/) since they are used as directory delimiters.
Re: auto fill today's date into data table nameThanks! But the date is not format in MM/DD/YYYY. It returns 3729589915.
Re: auto fill today's date into data table nameHi @Isabel26
perhaps this will work:
Data Table( "old name" ) << Save( "C:\old name "|| char (Today())||".xlsx" );