Overview
Introduction
Plain-text tables aligned with spaces, like the output of the Unix `column -t` command, are easy to read but not directly usable as data. This tool reverses that formatting back into structured, standard CSV.
It treats runs of two or more spaces (or a tab) as column boundaries, which is the same heuristic `column -t`-style output relies on for humans to read it correctly.
What Is Text Columns to CSV Converter?
A text-to-CSV parser that detects column boundaries in whitespace-aligned plain text and produces properly delimited, RFC 4180-quoted comma CSV.
It's the inverse of the CSV to Text Columns converter: one turns structured data into readable text, this turns readable text back into structured data.
How Text Columns to CSV Converter Works
Each line is trimmed of leading and trailing whitespace, then split wherever two or more consecutive spaces (or a tab) occur, since a single space is assumed to be part of a cell's own text.
Blank lines are skipped, and the resulting rows of cell values are re-serialized as comma CSV, quoting any cell that itself contains a comma, quote character, or newline.
When To Use Text Columns to CSV Converter
Use it when you've received a plain-text table, from a terminal, a log file, documentation, or an email, and need it as real CSV for a spreadsheet or script.
It's also the natural second half of a round trip after using CSV to Text Columns to make data readable, then converting it back.
Often used alongside CSV to Text Columns Converter, CSV to TSV Converter and CSV Delimiter Changer.
Features
Advantages
- Correctly distinguishes column-separating whitespace (2+ spaces or a tab) from single spaces inside a value like a person's name.
- Produces properly RFC 4180-quoted CSV output, so fields containing commas are preserved without corrupting the structure.
- Runs entirely client-side, so pasted text never leaves your browser.
Limitations
- Columns separated by only a single space can't be reliably detected and will be read as one combined value.
- If the original alignment used inconsistent spacing (some rows use 2 spaces, others use 3+ with extra padding), values may split at slightly different points than intended; a wider gap in one row can still split correctly, but be aware the heuristic is whitespace-run-based, not position-based.
Examples
Best Practices & Notes
Best Practices
- Make sure your source text uses at least two spaces (or a tab) between every column, one space is not enough to detect a boundary reliably.
- Check values with internal single spaces (names, addresses) in the output to confirm they weren't accidentally split.
- Pair with CSV to Text Columns to verify a round trip reproduces the same aligned layout.
Developer Notes
Column splitting uses the regex `/[ \t]{2,}/` against each trimmed line, which is the same rule of thumb tools like `column -t` and Markdown-table-to-CSV converters rely on: a run of 2+ horizontal whitespace characters is a boundary, a single space is data. There's no attempt to align split points across rows by character position, since fixed-width alignment is exactly what per-row whitespace runs already encode.
Text Columns to CSV Converter Use Cases
- Turning a `column -t` command's terminal output back into CSV for further processing
- Converting a hand-aligned plain-text table from documentation, a log file, or an email into structured data
- Completing a round trip after using CSV to Text Columns to make data human-readable temporarily
Common Mistakes
- Using only a single space between columns in the source text, which this tool cannot distinguish from a space inside a value.
- Expecting tab-delimited (TSV) input to need this tool; use TSV to CSV instead, since TSV already has an unambiguous delimiter.
Tips
- If a column looks merged in the output, check whether the source used only one space instead of two between those particular values.
- For a value that legitimately needs 2+ consecutive spaces preserved (rare), this tool isn't the right fit, since it will always treat that run as a boundary.