You can store the result of algorithm flow or the Reader into a CSV dataset. You can use the TemplateFile node to create target file datasets within the application. These target files are stored in CSV format and can be reused as CSV dataset within the same workspace.
Note: | This function can be used in Workbook as well as Workflow. This description assumes the function is being used in Workbook. However, you can also use it in a Workflow. |
To write the output data to a template file, follow the steps given below.
Build your algorithm flow. Refer to Building Algorithm Flow in a Workbook Canvas.
Run your algorithm flow. Refer to Running a Workbook.
Use the drag-and-drop method to insert the TemplateFile node from the Task Pane into the canvas.
Connect the node whose resultant data you want to write to a file to the TemplateFile node.
In the image above, the node Sorting is connected to the TemplateFile node. The result of Sorting will be written to TemplateFile.
From the Properties pane, select the configuration settings for the TemplateFile.
Field | Description | Remark |
Task Name | It displays the name of the selected task. | You can click the text field to edit or modify the name of the task as required. |
DROP AND RECREATE | It drops previously created dataset and updates with new structure and records. | |
OVERWRITE FILE | It allows you to overwrite an existing file. | — |
APPEND FILE | It allows you to append to the existing file. | — |
Select Delimiter | It allows you to select the delimiter to use in the CSV file. | The available options are - Comma (,) Pipe (|) Tab Space |
Dataset Name | It allows you to enter the name for your template file. | If a file with the specified name already exists, the data is either overwritten or appended, based on the selection. In the above example, the name is CarboFitness_SortedData. |
If a file with the specified name already exists, you can drop and recreate or overwrite it or append it.
Select DROP AND RECREATE to drop the existing dataset and recreate with the updated records and structure. Select OVERWRITE FILE to overwrite the dataset.
Select APPEND FILE to append to the existing dataset.
| These options are not applicable if the file is being created newly. |
From the Select Delimiter drop-down, select the delimiter used in your source file.
Enter the Dataset Name for the newly created dataset.
To run the TemplateFile node, click the ellipsis on the TemplateFile node, and then click Run.
After a successful run, the data is written to the file specified by Dataset Name. It is available to be used as a dataset under Reader