Fixed-Width Parser
Parse fixed-width columnar text into CSV.
Overview
The fixed-width parser carves up columnar text — the format you find in legacy mainframe exports, bank statements, and tabular reports — and emits clean CSV. You specify column widths (or paste a header line and let the tool guess), and each row gets split at the right byte boundaries.
Banking integrations, healthcare systems, and government data feeds still ship in fixed-width formats. Developers and analysts working with those exports use a fixed width to csv converter to bridge to modern tooling without writing custom substring code.
How it works
Fixed-width files use position-based columns: each column occupies a defined number of characters, padded with spaces (or zeros for numerics). The parser slices each line at the configured offsets and trims each segment to remove the padding. CRLF and LF line endings are both accepted.
When you don't know the column widths, paste the header row and the auto-detect mode finds runs of non-space characters separated by two or more spaces, treating those gaps as column boundaries. The widths are reported so you can confirm and adjust.
Examples
Widths: 10, 5, 8
Input:
Alice 030 87.5
Bob 042 91.0
Carol 035 76.2
Output (CSV):
Alice,30,87.5
Bob,42,91.0
Carol,35,76.2
Auto-detected widths from header
Input:
NAME AGE SCORE
Alice 30 87.5
Bob 42 91.0
Output:
NAME,AGE,SCORE
Alice,30,87.5
Bob,42,91.0
FAQ
Does it count bytes or characters?
Characters, using the input's encoding once decoded. If your source is a mainframe EBCDIC dump, decode it to UTF-8 first; column widths are typically defined in single-byte characters anyway.
What if a column contains the padding character?
Trimming defaults to right-trim only, so leading characters that happen to be spaces are preserved. Configure the trim mode if your data needs both sides trimmed or none.
Are zero-padded numerics handled?
Numeric columns padded with leading zeros (0042) are emitted as 42 by default, which matches what most CSV consumers expect. Toggle the preserve-leading-zeros option if you need the original string.