The function of the File Output operator is introduced in Function Description of the File Output Operator. This document uses two simple examples to demonstrate how to use the File Output operator.
This example demonstrates how to output processed data as a CSV file to an FTP/SFTP server.
Configure an FTP/SFTP data connection, on which you should have the use permission. For details, see FTP/SFTP Data Connection.
Process data in a Data Transformation node. For details, see the "Example" chapter (except for the "Subsequent Data Processing" section) of Function Description of New Calculation Column.
1. Add a File Output operator and connect it to the New Calculation Column operator.
2. Output the processed data to the data folder on the FTP/SFTP server. Name the file Contract_Fact. Note that files within the same folder must have unique names.
The column separator defaults to Comma, the line separator defaults to CR+LF (used in Windows systems), and the text qualifier defaults to Double Quotes. Output Field Names to First Row is ticked by default. With it ticked, field names are written to the first line of the file. Duplicate Handling Strategy defaults to Stop Writing and Report an Error.
1. The column separator, text qualifier, and line separator must be unique. For the resulting output format, see the "Effect Display" section of this document.
2. The File Split function is not used in this example. For details about this function, see Function Description of the File Output Operator.
3. Click the Save button in the upper right corner.
1. Click the Run button to execute the task, as shown in the following figure.
2. Once the task completes successfully, the Contract_Fact file will appear in the data folder on the FTP/SFTP server, as shown in the following figure.
You can open the output CSV file and check the data. Commas (highlighted in pink) separating data into multiple columns, double quotes (highlighted in orange) enclosing data values, and each row is displayed on a new line (as the row separator CR+LF representing line breaks).
This example demonstrates how to output every 100 rows of data as a separate Excel file to an FTP/SFTP server.
1. Configure an FTP/SFTP data connection, on which you should have the use permission. For details, see FTP/SFTP Data Connection.
Create a scheduled task, drag in a Data Transformation node, enter its editing page, drag in a DB Table Input operator, and configure it to obtain the data to be output, as shown in the following figure.
Notes
Description of single-sheet data capacity of Excel files:
Excel 2003 and earlier: A single sheet supports up to 65,536 rows and 256 columns.
Excel 2007 and later: A single sheet supports up to 1,048,576 rows and 16,384 columns.
Procedure
1. Drag in a File Output operator. Select an FTP/SFTP data connection, set Folder Address to /home/okcean/data, and name the file Order_Details. Note that files within the same folder must have unique names.
Output Field Names to First Row is ticked by default. With it ticked, field names are written to the first line of the file. Tick File Split and set the criteria to Split Every 100 Row(s) into a New File. Duplicate Handling Strategy defaults to Stop Writing and Report an Error.
2. Click the Save button in the upper right corner.
2. Once the task completes successfully, three order details files will appear in the data folder on the FTP/SFTP server, as shown in the following figure.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy