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.
The table given below describes different fields in the properties of 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. |
OVERWRITE DATASET IF PRESENT | It allows you to overwrite an existing file. | — |
APPEND DATASET IF PRESENT | 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 either overwrite it or append it. Select OVERWRITE DATASET IF PRESENT to overwrite the dataset.
OR
Select APPEND DATASET IF PRESENT 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 in Model Studio.
You can make use of this newly created dataset to build your future algorithm flows.