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.
Limitations
- Relies on the 2-or-more-space convention for column boundaries; single-space-separated columns can't be distinguished from multi-word values.
Examples
Best Practices & Notes
Best Practices
- Use this together with the Text Columnizer to round-trip a list through an aligned display and back.
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.