Write File

../../_images/writeFileNode.png

The Clario Write File node is used to write out either a delimited or fixed-length flat file. Files can be written to either the Shared Files or Project Files location.

Configuration

The Write File node has two configuration tabs: Define File and Define Attributes.

Define File Tab

../../_images/writeFile_defineFileTab.png

Specifying File

The first step in configuring a Write File node is specifying the output file name. This can be accomplished in one of two ways: specifying a new file or selecting a file. Make sure you select the correct file location as files with the same name may be located in both shared and project files. Writing to a file that already exists will overwrite the existing file.

New File

Create a new file name by typing in the file name field. New file names may contain User-Defined Function references.

Select File

Select a file by clicking [Select], which launches the File Browser. Select the desired file from the list and click [OK].

Raw File Preview

Once a file has been specified, click the [Preview] button to display a Raw File Preview of the first 50 rows of the selected file, unformatted. This is valuable for defining the format of the file. A file can only be viewed after the workflow has been run and a dataset has been created. If a previously created file was selected to be overwritten, the previously created file will be viewable.

Location

This is where the output file will be written to. Locations may contain User-Defined Function references. If a constant reference is used to identify the location, it must resolve to “project” or “shared”. If no location is specified, it will default to project.

Type

Clario supports delimited or fixed file formats. If delimited is selected, you will need to specify the delimiter and, optionally, the enclosure.

Delimiter

Select the attribute delimiter from the drop down. The available delimiters are comma, semi-colon, pipe, double pipe, tab, and space.

Enclosure

To write enclosures, the enclosure type (single quote or double quote) must be specified. Leave enclosure blank if none is desired.

Include Header Row

To include a header row of attribute names in the output data file, put a check by Include Header Row. If selected for fixed files, the attribute name will be truncated to the length of the attribute it identifies.

Define Attributes Tab

../../_images/writeFile_defineAttributesTab.png

Incoming Name

Incoming Attribute Names are automatically populated based on the data stream attached to the Write File node’s incoming connector.

Outgoing Name

Attribute Names can be changed in the Edit Attribute dialog by double-clicking the desired row. Attribute names may only consist of the following characters: A-Z, a-z, 0-9, ‘-‘, and ‘_’.

Type

Types are automatically populated based on the data stream attached to the Write File node’s incoming connector. Type cannot be changed.

Start

Required if a fixed-length file was specified. Specifies the starting position of the attribute. Each data row starts in position 1.

Length

Required if a fixed-length file was specified. Specifies the length to write from the attribute’s starting position.

Format

Format is automatically populated for Date (default YYYY-MM-DD) and Number (default #.####) type attributes. Format can be changed in the Edit Attribute dialog by double-clicking the desired row. Valid formats are listed in a drop-down box.

Import

../../_images/writeFile_importAttributes.png

The Write File node allows users to Import attribute definitions directly from a comma separated file via the [Import] button. In the Import dialog enter the following values depending on the file type:

  • Fixed Length Format: NAME, TYPE, START_POSITION, LENGTH, FORMAT
  • Delimited Format: NAME, TYPE, FORMAT

After clicking [Save] in the dialog, you return to the Define Attributes tab that is now populated.

Export

Attribute definitions can be exported to a spreadsheet by clicking [Export]. You will be prompted to enter a filename before downloading.

Formatted File Preview

Clicking [Formatted File Preview] will display the first 50 rows of data in a grid using the configuration from both the define file and define attributes tabs. A file can only be viewed after the workflow has been run and a dataset has been created.