You are viewing the RapidMiner Studio documentation for version 8.1 - Check here for latest version
Rename File (RapidMiner Studio Core)
SynopsisThis operator renames a file or a folder.
The Rename File operator allocates a new name to a selected file or folder. Please ensure that the new name of your file has the right ending, e.g. '.xls' as in our Example Process.
- through (Data Table)
It is not compulsory to connect any object with this port. Any object connected at this port is delivered without any modifications to the output port. This operator can have multiple inputs. When one input is connected, another through input port becomes available which is ready to accept another input (if any). The order of inputs remains the same. The object supplied at the first through input port of the Rename File operator is available at the first through output port.
- through (Data Table)
The objects that were given as input are passed without changing to the output through this port. It is not compulsory to attach this port to any other port, the file is renamed even if this port is left without connections. The Rename File operator can have multiple outputs. When one output is connected, another through output port becomes available which is ready to deliver another output (if any). The order of outputs remains the same. The object delivered at the first through input port of the Rename File operator is delivered at the first through output port
- fileThe file or folder that should be renamed is specified through this parameter. Range: file
- new_nameThe new name of the file or folder is specified through this parameter. Range: string
Writing the Labor-Negotiations data set into an Excel file and renaming it
This Example Process shows how the Rename File operator can be used to rename a specified file. For this Example Process you first need a file to rename. An Excel file is created by loading the 'Labor-Negotiations' data set with the Retrieve operator and writing it into an Excel file with the Write Excel operator. The file is saved as 'D:\Labor data set.xls' if this file does not already exist. A breakpoint is inserted so you can have a look at the Excel file in your D drive. For further understanding of this operator please read the description of the Write Excel operator.
The Rename File operator is inserted without any connections. The file parameter is set to 'D:\Labor data set.xls' and the new name parameter to 'labor_data_set.xls'. Run the process and the file in your D drive which was formerly named as 'Labor data set.xls' will now be named as labor_data_set.xls'.