Exchanging Two Columns, Header Included
Exchange two positions while keeping the rest of each record. If an import template expects ID before Name, swap those columns rather than extracting a field and rebuilding the table. The header moves with its values. This tool does not infer types, trim spaces or change identifiers to numbers.
Choosing a Mode and Two Column Numbers
- Paste a small representative dataset, or use Sample.
- Choose Quoted mode for CSV-style quoting, or Literal mode for an exact separator without quote interpretation. Use Tab for TSV.
- Set Column A and Column B to positive whole-number positions, starting at 1.
- Review complete output and any error before Copy or Download. If Copy fails, select the output manually. Clear restores empty input and default settings.
How Raw Fields Are Swapped and Rechecked
The parser keeps each field's raw spelling, including quotes and spaces, each record ending and an initial U+FEFF marker. Swapping reorders those strings; it does not decode and rewrite every field. Quoted mode handles doubled quotes and quoted newlines. Literal mode treats quotes as data and matches a nonempty exact separator.
Before showing output, the tool reparses the candidate and checks its marker, record boundaries/endings and intended raw field order. A moved value can otherwise form a delimiter across a boundary or expose U+FEFF as an initial marker. An ambiguous candidate is blocked instead of being silently escaped or partially exported. Accepted swaps retain the intended field identities; applying the same pair again restores the received source string.
Six Swaps: Four Accepted, Two Blocked
Successful outputs use JSON string notation so line endings and quotes are visible. U+FEFF is shown as \uFEFF rather than an invisible character. Blocked examples produce no exportable output.
| Input and settings | Complete output | What to check |
|---|---|---|
"Name,ID\r\n\"Doe, Jr.\",00123". Quoted comma, columns 1/2 | "ID,Name\r\n00123,\"Doe, Jr.\"" | Header and raw quoted name move together |
"\uFEFF\"a\",b\r\nc,d\n". Quoted comma, columns 1/2 | "\uFEFFb,\"a\"\r\nd,c\n" | Original marker, quotes and mixed record endings survive |
"a::b\r\nc::d". Literal ::, columns 1/2 | "b::a\r\nd::c" | A safe multi-character separator remains supported |
A,B. Quoted comma, columns 1/1 | "A,B" | Same-column selection is unchanged but still validates the column |
A|||. Literal ||, columns 1/2 | No output: field-boundary error | A moved pipe would change the parsed fields |
"A,\uFEFFB". Quoted comma, columns 1/2 | No output: initial-marker error | Quote the marker-bearing value in Quoted mode or choose another order |
When to Swap, and What to Do When It Is Blocked
Use this for a known two-column exchange, including the header. If you only want one field, choose Extract Column. Keep a copy of the source and check the target import requirements before replacing an export.
| Situation | Next step | Limit |
|---|---|---|
| Quoted names or multiline notes | Quoted mode with the source delimiter | One UTF-16 delimiter unit, excluding quotes/line breaks; no type inference |
| Exact multi-character separator | Literal mode, then inspect the accepted result | Boundary-changing permutations are rejected |
| U+FEFF payload would become a marker | Quote that source value in Quoted mode or keep its current position | The tool does not add quoting behind your back |
| A row lacks a selected field | Correct that source record or change the selected columns | No partially swapped batch is exported |
Limits, Downloads and Browser Behavior
A same-column swap still checks that the field exists. Headers are data and move too; they are not guessed or skipped. Blank records remain records, and a final line ending does not create an extra row. Quoted mode rejects malformed quoting, including unexpected text after a closing quote. Literal mode is appropriate only when quotes should be ordinary characters.
Limits are 1,000,000 UTF-16 code units and 20,000 records. Incomplete Unicode in source or delimiter blocks output. A supplementary-character delimiter needs Literal mode because it uses two units. Typing backslash-t is not a tab. Error messages leave the source editable, and Copy/Download stay disabled until a valid result exists.
Download saves swapped-columns.txt; it does not validate a spreadsheet schema or make formulas inert. Swapping runs in your browser on the text you paste, not on the bytes of an original file; the Privacy Policy covers site-wide data handling. Browser clipboard, textarea and receiving-file behavior need their own checks.
Try a quoted delimiter, an empty field, meaningful spaces and mixed record endings in a small fixture. Compare an accepted result with the source, including header order and marker placement. Informational RFC 4180 explains common CSV quoting; the alternative separators and line endings here are explicit extensions.