Writing Data to the Template File

Writing Data to the Template File

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 Workflow Canvas.

Run your algorithm flow. Refer to Running a Workflow.

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.

DROP AND RECREATEIt 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.



Note
:

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.



    • Related Articles

    • Writing to Template File

      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 ...
    • Writing Data to the Template Table

      You can store the result of algorithm flow or the Reader to a dataset table. Note: You can write to an RDBMS or ODBC (SQL, MySQL, PostgreSQL, or Oracle) datasets only. To write the output data to a template table, follow the steps given below. Build ...
    • Writing into Template Table

      You can store the result of algorithm flow or the Reader to a dataset table. Note: You can write to an RDBMS or ODBC (SQL, MySQL, PostgreSQL, or Oracle) datasets only. To write the output data to a template table, follow the steps given below. Build ...
    • Adding a Template

      There are two types of Data Template that can be created. We can create a Data Template for a single thing and Gateway Data Template for multiple things. You can add a data template by Clicking Data Templates in the Manage dropdown (for the first ...
    • File Path

      Note The File Path option is disabled for use in SAAS. It will work in Desktop application only. Rubiscape provides you six options to select the source to create a dataset. The available options are: Upload File S3 FTP Azure Blob Storage File Path ...