Fixed Width to CSV Converter
Paste report text or a file where each column sits at the same place on every line. The columns are found from the gaps, or you can give start positions or widths.
Drag a file here or choose one
Worked examples
Gaps found automatically
Name City Score Ann Lee Leeds 42 Bob Ray York 37
Name,City,Score Ann Lee,Leeds,42 Bob Ray,York,37
Columns start at positions 1, 12 and 21.
Widths
20240315ABC 20240316XYZ
2024,03,15,ABC (widths 4, 2, 2, 3)
Widths cut each line into pieces of fixed length.
About Fixed Width to CSV Converter
Older systems, mainframe reports and some government files do not use separators. Each field simply sits in the same character positions on every line, padded with spaces. This converter turns such text into a table you can save as a CSV. By default it finds the columns for you by looking for the places where every line is blank and starting a new column after each gap.
If two columns run together with no gap, give the positions yourself. Start positions count from 1, so 1, 12, 20 begins columns at the first, twelfth and twentieth character. Column widths work from the other direction: 11, 8, 6 makes columns of those lengths. A guide under the text marks where each column begins, so you can see what was found and adjust. Spaces around values are trimmed unless you turn that off.
How to use Fixed Width to CSV Converter
- Paste the text or open a file.
- Leave the setting on finding columns from the gaps, or choose start positions or widths and type them.
- Check the guide under the text and the preview. Tick whether the first line is a header.
- Download the result as a CSV.
Common uses
- Reading a report copied from an old system
- Converting a bank or government data file with set positions
- Pulling a table out of text copied from a PDF
- Preparing fixed width data for a spreadsheet
Frequently asked questions
How are the gaps found?
A character position counts as a gap when every line has a space there, or is shorter than that position. A new column starts at the first position after each gap.
What if values contain spaces?
Gap detection still works as long as some line has a character in the middle of the space, which is usual. If it splits a value wrongly, give start positions or widths instead.
How do start positions work?
They count from 1. The text Name City starting at positions 1 and 6 gives Name and City. If the first position is not 1, a column from position 1 is added.
What do widths mean?
The length of each column in characters. Widths 12, 12, 5 make three columns, the first from character 1 to 12, the next from 13 to 24 and the last from 25 to 29.
Do tabs work?
Tabs are treated as four spaces before the text is split. If your file uses real tab separators, use the delimiter converter.