RapidMiner

RapidMiner now offering a 30 day free trial of RapidMiner Studio Large! Learn more

Wirte file with date in filename

SOLVED
Contributor II Nicson
Contributor II

Wirte file with date in filename

Hi

is there a possibility to automatically integrate the current date into the file name when saving files (e. g. write excel)?

As an example, the file should be called "filename_yymmdd.xls".

 

Best regards

1 REPLY
RM Research
RM Research
Solution

Re: Wirte file with date in filename

Hi Nicson,

 

you can integrate the name by using a macro.

By default, each process has a macro called process_start, which has the following format "2018_03_13-AM_11_12_01", which might be a bit long.

With the Generate Macro, you can use String manipulation to shorten it to the first 10 characters, if you are only interested in the data. Alternatively you can use the data_now() function and extract the parts of the date you need.

 
To add the macro to you just add it to your desired file name with the %{macro_name}  syntax. In case this could look like that:

"filename_%{date_macro}.xls"

 

There is also a very good knowledge base about macros available if you want to learn more:

https://community.rapidminer.com/t5/RapidMiner-Studio-Knowledge-Base/How-to-Use-Macros/ta-p/32966

 

Best,
David

------------------------------------------------
Senior Data Scientist at RapidMiner research team
ezCater's RapidMiner Journey