Fixed width format

<< Click to Display Table of Contents >>

Navigation:  Reference > File formats >

Fixed width format

Easy Data Transform can input from fixed width format files, also known as fixed column width format. Default file extension ".txt". It is also possible to output to fixed width format (see below).

 

Fixed width format is used for exchanging tabular data between programs. It is often associated with legacy systems, but is also used for large files where performance is an issue (e.g. bioinformatics).

 

In fixed width format each column has a fixed width in characters. There is no column delimiter. Spaces are typically used as padding to make up the column width. The row delimiter is Line Feed, Carriage Return or

Carriage Return+Line Feed. For example:

 

example fixed width format file

 

Is input as:

 

input fixed width data format

 

Easy Data Transform will analyze the data and guess the column layout if you set Columns in the Right pane to Automatic. Or you can choose the column widths by setting Columns to Manual. Click the '...' button to edit the manual column widths.

 

convert fixed width data format file

 

The current column boundaries are shown on the first few rows in the Preview. The horizontal offset of each character is shown in gray at the top. The currently selected columns are highlighted. Click on a column in the Preview to select it in the table, or vice versa.

 

You can change the column widths using the Width column of the table.

 

Select 2 or more adjacent columns and click Merge to merge them into 1 column. Click then Shift+click in either the table or the preview to select multiple adjacent columns.

 

Select 1 column with a Width > 1 and click Split to split into 2 columns.

 

Select 1 or more adjacent columns and click Insert Left or Insert Right to add a new column with width 1 to the left or right of the selected columns.

 

Select 1 or more adjacent columns and click Delete delete the selected columns.

 

Click OK to save your changes and Cancel to discard them.

 

Unwanted columns and rows in the dataset can be removed after input using the Remove Cols and Filter transforms.

 

There is no specific fixed width file output type. But you can output fixed width files:

Use the Extract transform to shorten any columns that are more than the desired length.

Use the Pad transform to pad with spaces any columns that are less than the desired length.

Use the Rename Cols transform to make columns headers the correct length.

Output to plain text format.

 

See also:

Video: How to convert fixed column width to CSV or Excel