Spoiler alert! Column editing is super simple in Notepad++ 🤓 All you have to do is press the Alt key while selecting text. You can use either Alt+Mouse Dragging or Alt+Shift+Arrows. This works perfectly on text that is already aligned. But what if your text is not formatted as columns already? You can quickly fix that by using the TextFX plugin.
Column Editing in Notepad++ using TextFX
In this example, we want to clean up a “table”. We have created the table by separating columns with the pipe (|) character. We want to reorganize the columns, then sort the data alphabetically.
Step 1: Line Up Columns using the TextFX Plugin
1. Select the pipe (|) character that separates the “columns” and copy it to the clipboard:
2. Select the text (CTRL+A) and click TextFX → TextFX Edit → Line up multiple lines by (Clipboard Character):
3. We have now lined up the text using the pipe (|) character to make it look like a table with columns:
Step 2: Move and Sort Columns
4. Use Alt+Mouse Dragging or Alt+Shift+Arrows to select the “colums” you want to move:
5. Drag the columns to the start of the first line. You can also Cut (CTRL+X) the selected columns, move the caret to the start of the first line, then Paste (CTRL+V) the columns there.
6. Select all the text, click Edit → Line Operations → Sort Lines Lexicographically Ascending:
7. We have now sorted the text alphabetically by the first “columns”:
Do you already have text formatted as columns? Then you can edit these columns by pressing the Alt key while selecting text. You can use either Alt+Mouse Dragging or Alt+Shift+Arrows.
Do you not already have text formatted as columns? No problem! Quickly fix this first by using the Line up multiple lines by (Clipboard Character) option in the TextFX plugin.
About the Author
Cathrine Wilhelmsen is a Microsoft Data Platform MVP, BimlHero Certified Expert, international speaker, author, blogger, organizer, and chronic volunteer. She loves data and coding, as well as teaching and sharing knowledge - oh, and sci-fi, coffee, chocolate, and cats 🤓