Tools84

TEXT FORMATTING / A PRACTICAL GUIDE

How toswap two columns in plain text

Exchange two fields in every row.

Swap two numbered columns of a consistently delimited text table.

Follow the guide
A real before-and-after example
Before Input for swap text columns

The original source text.

After Actual output for swap text columns

The downloaded text result.

The comparison uses the original input and the actual downloaded result.
Advertisements
QUICK VIDEO TUTORIAL Swap two text columns Swap two text columns English narration Watch the video

Swap two text columns

Advertisements

Swap two numbered columns of a consistently delimited text table. Follow the exact input and settings below to reproduce this example. Open Swap Text Columns.

01

Prepare the source text

Open Swap Text Columns and choose Write or paste text, or upload a supported UTF-8 text file. The upload opens the editor; it does not run the tool. This example uses the exact source shown in the comparison.

Maximum input and editable TXT result: 1 MB of UTF-8 text, with a 1,048,576-character input ceiling. Expanding transformations must also fit the TXT result limit. CSV files can be larger because they include column headings, quoting and separators.

Use the exact example input
Ada,London,42
Lin,Paris,37

This text operation runs in your browser; its source and result are not sent for conversion. A draft may be kept in this browser tab when session storage is available. Clear removes the current draft; download important work before closing the tab.

02

Choose the settings

For the recorded example, use these settings: Column separator: ,; First column: 1; Second column: 2.

Choose a literal Delimiter and the first and second column numbers. On rows that contain both fields, their values exchange places and the row is joined with the same delimiter. Rows missing either requested column are left unchanged.

Column separator
,
First column
1
Second column
2

The example in this guide

Verified in the i2TEXT browser workflow on November 11, 2026.

Input
example.txt
Output
swap-text-columns.txt
Saved result
26 bytes
03

Apply and inspect the result

Select Swap Text Columns when the input and settings are ready. In the saved example, the result begins: "London,Ada,42".

Quoted CSV fields are not parsed specially. A delimiter inside a quoted value is still a separator, so check the source structure first.

Result overview displays the table after the swap, with Rows, Columns and Rows with missing columns. Check the missing-column count: a row without either requested field stays unchanged.

Result overview distinguishes changed, unchanged and empty results. An unchanged result means the selected operation did not alter the text; an empty result can be the expected outcome of removal or extraction. The table shows 50 rows per page and at most 12 columns. Long cells are shortened after 160 Unicode code points on screen; CSV retains all rows, columns and complete values.

04

Save the version you reviewed

Review the table and choose TXT or CSV beside the download icon. TXT saves the editable result as swap-text-columns.txt; CSV saves the complete table as swap-text-columns.csv, including data beyond the visible preview. Continue to offers compatible next tools for the current text and their limits. Review the transferred text before running the next operation.

CSV describes the last conversion, so editing the result hides the table and disables CSV until you rerun the tool. Copy and TXT download still use your edited text. Formula-like CSV values receive a leading apostrophe to prevent spreadsheet formula execution.

The reviewed copy is ready

example.txtswap-text-columns.txt

A FEW USEFUL DETAILS

Common questions

Which settings produced this example?

Column separator: ,; First column: 1; Second column: 2.

What should I check before using the result?

Quoted CSV fields are not parsed specially. A delimiter inside a quoted value is still a separator, so check the source structure first.

Where is this text processed?

This text operation runs in your browser; its source and result are not sent for conversion. A draft may be kept in this browser tab when session storage is available. Clear removes the current draft; download important work before closing the tab.

YOUR TURN

Try Swap Text Columns with your own text.

Use your own source and review the result before sharing.

Open Swap Text Columns

Image detail

Language38

English العربية Français Italiano Deutsch Español Português Nederlands Русский Türkçe 日本語 中文 हिन्दी Bahasa Indonesia Bahasa Melayu 한국어 Tiếng Việt ไทย Polski Svenska Українська Norsk বাংলা Ελληνικά فارسی اردو Čeština Dansk Magyar Română Suomi Български Filipino ქართული Slovenčina Azərbaycanca עברית Slovenščina

Choose from 38 interface languages.