Write File

../_images/writefilenodeicon.png

Write File Node icon

The Clario Write File node is often the last component in a workflow, and is responsible for generating the output of any modified file(s) read in by the Read File node. The Write file node can write files in either a delimited or fixed-length flat file type. The node connector can be connected to a variety of nodes, (e.g. Read File, Aggregate, Outliers, Missing, etc.), but requires a valid stream of data.

Configuration

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

Define File Tab

../_images/writefiledefinefile.png

Define File tab

The first step in configuring a Write File node is specifying the the output file name. This can be accomplished in one of two ways: Typing the file name; Clicking [Select] and selecting a file with the file browser.

Create a new file name by typing in the file name text input. Entering a file name in this fashion allows you to embed Project Constant references in the file name. To reference a constant in a file name, place the constant name in squiggly braces. For example, to reference the “AsOfDate” constant, enter the file name like: Contacts-{AsOfDate}-output.csv (see Figure)

../_images/writefileconstantreference.png

File name with constant reference

Select a file by clicking [Select] which launches the File Browser. Only files that have been associated with the project will be displayed. Select the desired file from the list and click [OK].

Once a file has been specified, click the [Preview] button to display a Raw File Preview of the first 50 rows of the specified file, unformatted. This is a great way to learn the structure of the file. To close raw file preview, click [Close] in the bottom right corner.

The second step is to select the file type from the drop-down menu. Options are ‘delimited’ or ‘fixed’.

For delimited data files, specify the field delimiter (such as a comma, pipe, tab, semi-colon, etc.), and, if desired, check ‘Enclosure’ box and specify the field enclosure (single quote or double quote). Leave this empty if you do not want an enclosure.

To include a header row of attribute names in the output data file, put a check by [Include Header Row]. Even though this option is available for both delimited and fixed format files, it is really only useful for delimited files. If used with fixed files, the attribute name will be truncated to the length of the data field it identifies.

Define Attributes Tab

../_images/writefiledefineattributes.png

Define Attributes tab

The file type being written (delimited or fixed) determines what steps to take within the define attributes tab. If file type is delimited, for each attribute in the data file the Incoming Name, Outgoing Name, and Type are required, while Format is optional for all the attributes. If the file type is fixed then for each attribute in the data file, Incoming Name, Outgoing Name, Type, Start Position and Length are required, while Format is optional once again. The Name and Type are populated from the input data stream’s metadata. Additionally, the Write File node allows users to import attribute definitions directly from a comma separated file via the [Import] button. It can be helpful to save the Write File attribute definitions for future use in another workflow. To do so simply click [Export] and you’ll be prompted to enter a filename before downloading the spreadsheet.

For each attribute, enter a valid Start Position and Length. While you cannot edit the Incoming Name, you can edit the Outgoing Name by double-clicking and editing the name, see tips on Valid Characters for Attribute Names. There is no limit to the length of attribute names. Here you can also change the Format, for Number and Date data types.

Number Formats

Full Precision

#.#### (default)

# (integer)

#.# (one decimal place)

#.## (two decimal places)

#.### (three decimal places)

#.#### (four decimal places)

#.##### (five decimal places)

#.###### (six decimal places)

Date Formats

If an attribute’s type is defined as a date, you must define a format using the drop-down boxes. The allowed formats include dates and datetime formats.

Results

There are no results for the Write node. Formatted File Preview can be used to view a sample of the file that has been written out. It is assumed the Write node will be used to write out a dataset to be read in for future use in a data stream, or to be downloaded via SFTP.

Output Stream

The dataset is ready for immediate use in a Read File node.

Table Of Contents

Previous topic

Univariate

Next topic

Functions, Operators, and Constants