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 Types 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 the user can visualize where a column will break.

  • To assign column breaks, place your cursor where the break should be. Alteryx will automatically determine the appropriate field length and the grid section will populate based on these breaks.
  • Delete the column break lines by clicking on 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 there are a few check boxes. These settings are explained below.

  • Allow Short Lines: Indicates if 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: Indicates if there can be extra characters after the last field for the current record. This extra data will be discarded. By default, this box is not checked.
  • Trim Spaces: Removes 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. Default is CRLF. Options include: None, CRLF (Windows), LF (Unix), 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. The user can assign their own field Name by selecting the default name and typing in the box.
  • Type: The type of the data field. Default is V_String. To change the data field, click on the default. A dropdown list will appear 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, click on the default and type in the appropriate value for a field's length. The column break will automatically be 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, the user must change the Type to fixed decimal and adjust the length and scale accordingly by clicking on the defaults and typing the new values.

File Handling Options

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

  • Embed Field Settings in the Workflow: The field settings will 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/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. Clicking the Import Button will allow the user to browse to aFlat ASCII file (*.flat) that contains the field settings to be applied to the data. These settings will then be 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 the user configures this box, they can return to these setting at anytime via the Input tool's Configuration Properties Window. In the Options Pane, #5: File/Field Layout - Has Value. Click the to be returned to Flat File Field Settings.