Categories

Versions

(AI Studio Core)

Synopsis

This operator copies the chosen file to the specified destination.

Description

The Copy File operator copies the file specified in its parameters to the indicated destination. If the inserted path does not already exist the needed folders and the file are created. It is also possible to overwrite an existing document.

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 Copy 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 copied even if this port is left without connections. The Copy 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 Copy File operator is delivered at the first through output port.

Parameters

  • source fileThe file that should be copied is specified through this parameter.
  • new fileThe copied file is saved as the file and at the target specified through this parameter.
  • overwriteIf this parameter is set to true a file specified in the new file parameter that already existed is replaced by the file specified in the source file parameter.

Tutorial Processes

Writing the Labor-Negotiations data set into an Excel file and copying it

This Example Process shows how the Copy File operator can be used to copy a specified file. For this Example Process you first need a file to copy. 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. For further understanding of this operator please read the description of the Write Excel operator.

The Copy File operator is inserted after Write Excel. The source file parameter is set to '%{tempdir}/Labor data set.xls' and the new file parameter to '%{tempdir}/test/Labor data set.xls'. Run the process and two files are created in a temp folder on your computer, the 'Labor data set.xls' of the Write Excel operator and the 'Labor data set.xls' in a separate folder named 'test'.