What is a Fixed Width Text File?  See here for Fixed Width Text File Definition.

What is a Fixed Width Text File? Fixed Width Text File Definition.

Fixed width text file definition discussed. Fixed Width Text File Conversion Tools by Softinterface.

Fixed Width Text File Definition:

Above all, a fixed width text file is a file that has a specific format which allows for the saving of textual information/data in an organized fashion. 


Fixed width text files are special cases of text files where the format is specified by column widths, pad character and left/right alignment.  Column widths are measured in units of characters. For example, if you have data in a text file where the first column always has exactly 10 characters, and the second column has exactly 5, the third has exactly 12 (and so on), this would be categorized as a fixed width text file.


To be very specific, if a text file follows the rules below it is a fixed width text file:

  • Each row (paragraph) contains one complete record of information.
  • Each row contains one or many pieces of data (also referred to as columns or fields).
  • Each data column has a defined width specified as a number of characters that is always the same for all rows.
  • The data within each column is padded with spaces (or any character you specify) if it does not completely use all the characters allotted to it (empty space).
  • Each piece of data can be left or right aligned, meaning the pad characters can occur on either side.
  • Each column must consistently use the same number of characters, same pad character and same alignment (left/right).

Below a typical fixed width text file is shown. It is specified by the following:

  • First column is 20 characters. It is left aligned. It is padded with spaces. It contains the NAME data within it.
  • Second column is 10 characters. It is left aligned. It is padded with spaces. It contains the STATE data within it.
  • Third column is 12 characters. It is left aligned. It is padded with spaces. It contains the TELEPHONE data within it.

So in total there are 42 characters per row:


NAME                STATE     TELEPHONE  

John Smith          WA        418-Y11-4111

Mary Hartford       CA        319-Z19-4341

Evan Nolan          IL        219-532-c301



If instead all three columns are right aligned it would look like this:

                Name     STATE   TELEPHONE

          John Smith        WA418-Y11-4111

       Mary Hartford        CA319-Z19-4341

          Evan Nolan        IL219-532-5301



Finally if in our original example we changed the alignment to right and the padding character were changed from space to the exclamation mark ! the fixed width text file would look like:

!!!!!!!!!!!!!!!!Name!!!!!STATE!!!TELEPHONE

!!!!!!!!!!John Smith!!!!!!!!WA418-Y11-4111

!!!!!!!Mary Hartford!!!!!!!!CA319-Z19-4341

!!!!!!!!!!Evan Nolan!!!!!!!!IL219-532-5301


123456789111111111122222222223333333333444

         012345678901234567890123456789012

Note: To best display a fixed width text file a fixed width font should be used (e.g. Courier).


Tools For Conversion of Fixed Width Text Files


Fixed Width Text Files Editor. Definition specified row by row. Fixed width text file defined row by row.

Contact

Need a custom tool for handling fixed width text files? Please do ask us.


EMail

Most responses are within hours. At most 24 hours.



Chat

7 AM to 5 PM PST