A fixed-width file has no commas or tabs: each field occupies a fixed number of characters, and Excel needs to know where each field starts and ends. A break placed one character out merges two fields or splits one value in half, and the error is silent because the numbers still look plausible. Set the breaks on the ruler in the wizard and check the first row before finishing.
What you need
- The fixed-width text file
- The field layout, with each field’s width, if the source documents it
- Excel with a blank workbook
Step 1: Open the file in a text editor and measure the fields
Open the file in a text editor with a fixed-width font and count the characters of each field on the first data row. Write down where each field starts and ends; that is where the breaks belong.
Step 2: Place the breaks in step 2 of the wizard
Import through the Text Import Wizard, choose Fixed width in step 1, then click on the preview ruler in step 2 to place a break at each field boundary. Drag a break to move it and double-click one to remove it.
Step 3: Check the first row field by field before finishing
Read the first row in the preview field by field against the text file: each value must sit whole in its own column, with no value split across two columns and no two values sharing one. Only then click Finish.
Worked example: synthetic fixed-width order file
The table below is a synthetic example. It shows the expected result of setting column breaks; no file was imported.
| Check | Value | Result |
|---|---|---|
| Fields in the layout | 4 | Code, name, quantity, price |
| Breaks placed | 3 | Between the 4 fields |
| First row after import | P-101, North, 12, 45 | Each value whole |
| Rows imported | 30 | All rows present |
| Values split across columns | 0 | No split values |
Expected result (UNTESTED). with 3 breaks placed at the field boundaries, the first row imports as P-101, North, 12, 45, each value whole in its own column, and all 30 rows load. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- A break placed inside a number splits it into two numbers, which then fail to add up.
- Fields that change width, such as a longer name, break a fixed-width layout; check the longest row, not just the first.
- A trailing space at the end of a field is part of the width; trimming after import is safer than moving the break.
- If the file has a header row of a different width, start the import at the first data row.
