What Is the Swap Columns Tool?
The Swap Columns Tool rearranges two specific columns within any delimited text — CSV, TSV, pipe-separated, or custom. Specify which two columns to swap by number, and the tool instantly exchanges their positions across every row while leaving all other columns untouched.
How to Swap Columns in Text
- Paste your delimited data into the left text area — one row per line.
- Set the Delimiter to match your data format (comma, pipe, tab, etc.).
- Enter the column numbers to swap in Col A and Col B — both use 1-based indexing (first column is 1).
- The swapped output appears instantly on the right. Click Copy or Download .txt to save it.
Where Can You Use the Swap Columns Tool?
Name Formatting
Flip a "Last Name, First Name" export to "First Name, Last Name" order for email personalization or system imports that expect a different column sequence.
Database Schema Migration
Reorder exported SQL data columns to match the exact import schema of a target database or spreadsheet without touching a script or IDE.
API Response Normalisation
Reorder columns in a CSV extracted from an API response to match the column order required by your data pipeline or ETL tool.
Spreadsheet Import Prep
Rearrange columns in a bulk import file to align with a template before uploading to Shopify, WooCommerce, or any CMS that requires a fixed column order.
How the Column Swap Works
- Exact delimiter split: Each row is split on the literal delimiter string. If Col A or Col B does not exist on a short row, that row is returned unchanged.
- 1-based indexing: Column 1 is the first column — there is no column 0.
- Swapping same column: If Col A equals Col B the output is identical to the input — no error, just a no-op.
- Download: The result can be saved directly as a
.txtfile for use in other tools or systems.
Best Practices and Limitations
All processing runs locally in your browser — no data is sent to any server, making it safe for confidential or proprietary datasets.
This tool does not parse RFC 4180 CSV quoting. If your data has the delimiter character inside quoted fields (e.g., "Doe, Jr.",John), those fields will be split incorrectly. For complex quoted CSV files, use a spreadsheet application. If swapped values have unwanted spaces, pass the result through the Trim Whitespace Tool first.
Share This Swap Columns Tool
Know someone who needs to rearrange CSV columns quickly? Share this tool!