Skip to main content

Flat File Layout

The Flat File Layout box allows the user to determine column breaks of a flat file where the columns are fixed width. This box displays when an unknown file type is brought into Alteryx via the Input Data tool and it is designated a Fixed Width file.

Data Preview

The top section of this box reveals a preview of the data file. The ruler along the top indicates the field length so that the user can visualize where a column breaks.

  • To assign column breaks, place your cursor where the break should be. Alteryx automatically determines the appropriate field length and the grid section populates based on those breaks.

  • Select the column-break lines to delete them.

  • Use the scroll bars beneath the file preview to reveal additional data within the file and assign the appropriate column breaks.

File Settings

Below the data preview are a few check boxes. Their settings are explained here:

  • Allow Short Lines: Indicate if a record can end before all fields are read. This is valid only for data with line ends. By default, this box is not checked.

  • Allow Long Lines: Indicate if there can be extra characters after the last field for the current record. This extra data is discarded. By default, this box is not checked.

  • Trim Spaces: Remove blank characters from field data. By default, this box is checked.

  • Record Length: This is the total character width of the longest record in the file.

  • EOL: End of line. This refers to the type of line ends used. The default is crlf. Options include none, crlf (Windows), lf (Unix), and cr (Mac.)

Column (Field) Settings

Below the file settings, there is a section that describes the field information the user is assigning. These settings are completely editable and described below.

  • Name: The name of the field. Default is Field_1 or the next sequential number. You can assign your own field name by selecting the default name and typing in the box.

  • Type: The type of data field. Default is V_String. To change the data field, select the default. A dropdown list appears with supported field types.

  • Length: The width of the data field. The default is what is manually set by the user's cursor placement in the preview section above. To change this value, select the default and type in the appropriate value for a field's length. The column break is automatically reflected in the preview pane above.

  • Scale: The scale field references the level of precision for a fixed decimal field. Default is 0. To change this value, you must change the Type to fixed decimal and adjust the length and scale accordingly by selecting the defaults and entering the new values.

File Handling Options

The next section allows you to specify how these configurations are handled, saved, or executed. These settings are described below.

  • Embed Field Settings in the Workflow: The field settings save with the workflow.

  • Use Field Settings from File: The user can open a Flat ASCII file (*.flat) to read in the field settings for the data

Import and Export Options

There are Import and Export buttons in the bottom left corner of the dialog box. The buttons can be used in combination with the file-handling options above.

  • Import: This button is active when Embed Field Settings in Workflow is selected. Selecting the Import button allows the user to browse to a flat ASCII file (*.flat) that contains the field settings to be applied to the data. These settings are then saved in the workflow.

  • Export: The user can save the field settings to a Flat ASCII file (*.flat) to be applied again either to a different file that follows the same layout or to the same file to be utilized in a different workflow. This option is available when either radio button above is selected.

After you configure this box, you can return to these settings at any time via the Input tool's Configuration Properties window. In the Options Pane, #5: File/Field Layout - Has Value. select the "..." icon to return to Flat File Field Settings.