DevTools Logo

Fixed Width to CSV

Fixed Width to CSV

Convert positional reports and mainframe dumps to CSV with detected or hand-tuned column boundaries.

Runs in your browser
Column starts (0-based):0
Try an example

Fixed-width source

1 lines0 columns wide0 auto-gaps

CSV output

Paste a fixed-width report to convert it

Column boundaries are detected from padding gaps or your own sample lines. Nothing is uploaded.

Details

Fixed Width to CSV turns space-aligned reports into real CSV rows. Column boundaries are character offsets: the tool detects them from padding gaps that persist across lines, from character-class transitions in two sample lines (including zero-space abutting columns), or you can set and nudge each start yourself. Structure controls skip leading/trailing lines, drop repeating page headers and remove form feeds. Cells are trimmed, inner space runs can be collapsed, numeric-looking columns can have decimal commas normalized to dots, and the result is serialized with RFC 4180 quoting. Everything happens locally — bank statements and vendor dumps never leave the browser.

More examples

Nightly bank statement

ACCOUNT      DATE         DESCRIPTION            AMOUNT
001234       2024-01-03   GROCERY STORE          -42,50
001234       2024-01-04   PAYROLL                1.250,00

The gaps after the account, date and description columns are detected automatically. Enabling decimal-comma normalization turns 1.250,00 into 1234.56 without touching the description.

No-gap COBOL listing

00123SMITH     0000450
00124JONES     0000120

Two sample lines let alignment diff find the digit-to-alpha transition at offset 5 even though there is no whitespace between the ID and the name.

Page-header cleanup

Page 2 of 4
NAME         SCORE
Ada          98
Page 3 of 4
Bob          87

Drop page lines removes the repeating headers and form-feed separators before conversion, so only genuine data rows reach the CSV.

Examples

Bank statement with European amounts

Input
ACCOUNT      DATE         DESCRIPTION            AMOUNT
001234       2024-01-03   GROCERY STORE          -42,50
001234       2024-01-04   PAYROLL                1.250,00
Output
ACCOUNT,DATE,DESCRIPTION,AMOUNT
001234,2024-01-03,GROCERY STORE,"-42,50"
001234,2024-01-04,PAYROLL,1234.56

Detected offsets 12, 24 and 47 split the columns; decimal-comma normalization only rewrites the numeric column.

Abutting COBOL fields

Input
00123SMITH     0000450
00124JONES     0000120
Output
col_1,col_2,col_3
00123,SMITH,0000450
00124,JONES,0000120

Alignment diff finds the digit-to-alpha transition at offset 5 even though the fields touch.

About this tool

Fixed Width to CSV converts column-aligned text — mainframe listings, bank extracts, vendor flat files — into comma-separated values. Instead of asking you to count characters by hand, it looks for whitespace runs that recur at the same position across lines, clusters the wobbling positions, and turns the surviving boundaries into column starts. You can always correct the result with the manual boundary controls.

Where a file has no padding at all, two sample lines reveal persistent character-class transitions such as digits changing to letters, and those boundaries can be merged with the gap-based ones. Structure options skip fixed file headers and footers, drop repeating page lines and strip form feeds; conversion options control trimming, inner-space collapsing, the output delimiter, header generation and decimal-comma normalization. Parsing and export run locally in your browser.

What this tool does not do

  • Continuation lines that wrap a record are not merged automatically; pre-join them before conversion.
  • COBOL copybooks and PIC clauses are not interpreted — offsets come from detection or manual entry.
  • A single boundary layout is applied to the whole file; mixed per-page layouts need separate passes.
  • The largest line in the input defines the width of the final column.

How to use this tool

  1. Paste or drop the report

    Paste the space-aligned text into the source panel. The footer reports line count and maximum line width.

  2. Detect or set boundaries

    Use Auto gaps for padded reports, Sample diff with two representative lines for abutting columns, or add and nudge column starts manually.

  3. Tune structure and conversion

    Skip file headers/footers, drop page lines, choose the delimiter, and enable decimal-comma normalization for numeric columns.

  4. Copy or download

    Review the CSV preview and its row/column statistics, then copy the text or download the .csv file.

Use cases

Import nightly bank extracts

Turn a padded statement into columns a spreadsheet or ledger can import, preserving comma-containing amount fields with proper quoting.

Migrate legacy reports

Feed COBOL-generated listings into modern pipelines without writing a one-off slicing script for each layout.

Audit vendor flat files

Inspect boundary confidence, fix a merged column on the spot, and export a trustworthy CSV manifest.

Boundary strategies and options

SettingEffect
Auto gapsInterior whitespace runs of at least two characters vote for a column start; nearby votes are clustered before a 60% support threshold.
Sample diffBoundaries where the character class changes at the same offset in every sample line — works with zero-space columns.
Manual startsZero-based character offsets shown as a list; each start can be nudged, removed or extended.
Skip first / lastRemoves a fixed number of lines from the beginning or end of the file.
Drop page linesRemoves lines like 'Page 2 of 4' and bare separators between pages.
Decimal commasNormalizes values such as 1.234,56 to 1234.56 only in columns inferred to be numeric.

A boundary is a column START offset; the last column ends at the widest line in the input.

Common mistakes

Mistake:Counting spaces instead of character offsets.

Fix:Boundaries are absolute positions from the start of the line. Use the detected list and the ruler-style controls rather than the number of spaces in a gap.

Mistake:Leaving page headers in the source.

Fix:Turn on Drop page lines (and skip fixed file headers/footers) before converting, or those lines become bogus CSV rows.

Mistake:Normalizing decimal commas in text columns.

Fix:Only enable the option when the target column is numeric-looking; the tool infers numeric columns from filled cells and leaves other values untouched.

Frequently asked questions

How does auto-detection find columns?

Every interior run of two or more spaces casts a vote for the position where the next column starts. Votes within two characters are clustered before the 60% support threshold is applied, so a boundary that shifts by a character on some rows still survives. The widest gap in a cluster wins, which keeps padded header separators from being overridden by short data gaps.

What if my file has page headers on every page?

Turn on Drop page lines. Lines such as 'Page 2 of 4' and bare separator lines are removed before conversion; form feeds can be stripped or turned into line breaks. Use Skip first and Skip last for headers and footers that appear only at the start or end of the file.

Can I set column positions manually?

Yes. Switch to Manual, then add a boundary and nudge each start one character at a time with the arrow controls or remove it entirely. Column starts are zero-based character offsets; the first column always starts at 0 and the last ends at the widest line.

How are decimal commas handled?

Enable decimal-comma normalization to rewrite values like 1.234,56 to 1234.56 and -42,50 to -42.50. The tool first infers which columns are numeric from their filled cells and only rewrites those, so a description containing a comma stays exactly as written.

Does my report leave the browser?

No. Detection, conversion and export all happen in the tab. There is no upload endpoint, no storage and no signup — which is why bank statements and other sensitive exports can be processed here.

References & standards