Files

Fixed Width File Inspector

Infers the column layout of a fixed width file when nobody can find the copybook.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Load or paste at least a few dozen lines. More lines give better boundaries, because a column is only cut where nothing has ever been written.
  2. Select Infer the layout.
  3. If two columns have been merged, raise the blank columns needed to split; if one column has been cut in half, lower it.
  4. Copy the start position and width columns straight into your parser specification.

What fixed width file inspector does

Fixed width files arrive from mainframes, banks and government systems, and they arrive without a layout roughly as often as they arrive with one. Reconstructing the layout by counting characters in a text editor works for the first three columns and then stops working, because a column whose values happen to be short in the first twenty rows looks narrower than it is.

This page infers the boundaries from the data instead. A position is a gutter only if it is blank on every sampled line, so a column is only cut where nothing has ever been written, and a wide value further down the file will not be sliced in half. The result gives each column a one-based start position, an end position, a width, an inferred type and a first value, which is the shape most parsers want their specification in. Nothing is uploaded.

Frequently asked questions

A character position is treated as a gutter only if it is blank on every sampled line, and a cut is made at the start of each run of gutter positions. That is conservative on purpose: it will never slice through a value, so a wide entry further down the file cannot be split in half by a boundary inferred from the first few rows.

They are separated by a gutter that is not blank on every line — usually because one value runs right up against the next somewhere in the file. Sample more lines to confirm, and if the columns genuinely touch, no inference can separate them and you need the real layout.

It sets how wide a run of always-blank positions has to be before it counts as a boundary. Raise it when a file uses wide gutters and a single blank position inside a value is producing spurious cuts; lower it when columns are separated by just one space.

The start position is one-based, matching the way copybooks and most parser specifications are written. The end position is the last character of the column, and the width is the difference, so a column starting at 1 with width 4 covers characters 1 to 4.