Skip to content

Edit columns in Notepad++ with TextFX plugin

This post is part 3 of 5 in the series Efficient work using Notepad++

Edit columns in Notepad++ with TextFX pluginNotepad++ with the TextFX plugin makes it quick and easy to do simple column editing. An application like Excel has many advanced features and might be more suitable in some cases. However, I always have Notepad++ open and it is often faster and easier to us the following approach for me.

At work we use JIRA for task management. I often have to create new or edit existing tables in task descriptions. Tables are created by using vertical line | characters. In this example I have a table where I need to change the order of the columns and sort the data. I also use this method when working with CSV files. This is how I do it in a few, simple steps.

Edit columns in Notepad++ with TextFX plugin

Edit Columns in Notepad++
1. Select the character that separates “columns” and copy it to the clipboard (CTRL+C), in this example the vertical line | character is copied to the clipboard.

Edit Columns in Notepad++
2. Select all the text (CTRL+A) and click TextFXTextFX EditLine up multiple lines by (Clipboard Character).

Edit Columns in Notepad++
3. The text is now lined up by the character you selected, in this example the vertical line | character. The text now actually looks like a table with columns.

Edit Columns in Notepad++
4. Hold ALT while you use the mouse to select the “columns” to be moved. You can also hold ALT+SHIFT and use the arrow keys to select instead of using the mouse. Cut the text (CTRL+X).

Edit Columns in Notepad++
5. Hold ALT while you use the mouse to select the “column” where the text should be inserted. You can also hold ALT+SHIFT and use the arrow keys to select instead of using the mouse. In this example you won’t actually select any text, just the empty column at the start of each line where the text should be inserted. Paste the text (CTRL+V).

Edit Columns in Notepad++
6. Select all the text (CTRL+A) and click TextFXTextFX ToolsSort lines case insensitive (at column).

Edit Columns in Notepad++
7. The text is now sorted alphabetically, in this example by the first two “columns”.

Edit Columns in Notepad++
8. Click SearchReplace (CTRL+H), choose Regular expression in the Search Mode and replace all “ +\|” (space, plus sign, backslash, vertical line – do not include quotation marks) with “|” (vertical line – do not include quotation marks). This replaces all instances where there are multiple spaces followed by a vertical line with just a vertical line.

Edit Columns in Notepad++
9. The end result has the same format as the original text, but columns have been moved and data has been sorted.

Who is Cathrine Wilhelmsen?

Cathrine is a Microsoft Data Platform MVP, BimlHero, Microsoft Certified Solutions Expert, author, speaker, blogger and chronic volunteer who loves teaching and sharing knowledge. She works as a consultant, architect and developer, focusing on Data Warehouse and Business Intelligence projects. She loves sci-fi, chocolate, coffee, craft beers, ciders, cat gifs and smilies :)

Comments

Hi! This is Cathrine. Thank you so much for visiting my blog. I'd love to hear your thoughts, but please keep in mind that I'm not technical support for any products mentioned in this post :) Off-topic questions, comments and discussions may be moderated. Thanks!

Click to Show / Hide Comments