Flat File Layout

Version:
Current
Last modified: March 26, 2020

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.
  • Click on 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: 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 is 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. 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. 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.

Was This Helpful?

Running into problems or issues with your Alteryx product? Visit the Alteryx Community or contact support.