Overview
Introduction
Undoing a columnar layout, to get back a plain flowing list of values, is fiddly to do by hand when the columns are padded with varying amounts of whitespace.
It runs entirely client-side, so nothing you paste is ever uploaded to a server.
What Is Column Text Converter?
A column text converter that collapses fixed-width columnar text, values separated by runs of 2 or more spaces, back into a single flowing list of values separated by a single space.
It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.
How Column Text Converter Works
Each line is trimmed and split wherever 2 or more consecutive spaces occur, and the resulting values from every line are flattened into one list and rejoined with single spaces.
The transformation happens synchronously in JavaScript the moment you type, with no network round trip involved.
When To Use Column Text Converter
Use it to flatten a padded, column-aligned block of text back into a simple list, ready for further processing or re-formatting.
It's a fast way to get the answer without opening a code editor, a REPL, or writing a one-off script just to check.
Often used alongside Text Columnizer and Find & Replace Tool.
Features
Advantages
- Correctly ignores single spaces within a multi-word value.
- Processes multiple rows at once, flattening them all into one list.
- Trims each line before splitting it, so an indented block does not produce a spurious empty first value on every row.
Limitations
- Relies on the 2-or-more-space convention for column boundaries; single-space-separated columns can't be distinguished from multi-word values.
- Every row is flattened into a single list, so the original row grouping is lost and cannot be reconstructed from the output.
Examples
Best Practices & Notes
Best Practices
- Use this together with the Text Columnizer to round-trip a list through an aligned display and back.
- Confirm your columns are separated by at least two spaces before pasting, because a single-space gap is treated as part of a multi-word value rather than a boundary.
- Convert tabs to spaces first if the source is tab-delimited, since the split looks specifically for runs of space characters.
Developer Notes
The implementation is `input.split(/\n/).flatMap((line) => line.trim().split(/ {2,}/))`, which trims each line before splitting so a leading indent doesn't create a spurious empty first value.
Column Text Converter Use Cases
- Reversing a column-aligned layout back into a plain list
- Extracting values from padded, tabular-looking text
- Preparing columnar data for import into another tool
Common Mistakes
- Feeding it text separated by single spaces or tabs, which won't be recognized as column boundaries.
- Expecting row structure to be preserved; all values are flattened into one list.
Tips
- Pair with the Text Columnizer to first inspect and then flatten a value list, or vice versa.
- A value that legitimately contains two or more consecutive spaces will itself be split apart, so collapse those internal runs before converting.