Categories

Versions

(AI Studio Core)

Synopsis

This operator renames a file or a folder.

Description

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.

Input

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

Output

  • 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

Parameters

  • fileThe file or folder that should be renamed is specified through this parameter.
  • new nameThe new name of the file or folder is specified through this parameter.

Tutorial Processes

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 '%{tempdir}/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. For further understanding of this operator please read the description of the Write Excel operator.

The Rename File operator is inserted after Write Excel. The file parameter is set to '%{tempdir}/Labor data set.xls' and the new name parameter to 'labor_data_set.xls'. Run the process and the file in a temp folder on your computer which was formerly named as 'Labor data set.xls' will now be named as labor_data_set.xls'.