Skip to content

Notepad++ Column Editing

This post is part 3 of 5 in the series Notepad++ Tips and Tricks
Logo for blog post "Column Editing in Notepad++"

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.

Animation showing column editing in Notepad++

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:

Screenshot showing copying the column separator
Select column separator and copy to clipboard (CTRL+C)

2. Select all the text and use Line up multiple lines by (Clipboard Character):

Screenshot showing clicking "Line up multiple lines by (Clipboard Character)"
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:

Screenshot showing text formatted as table

Step 2: Move and Sort Columns

4. Use Alt+Mouse Dragging or Alt+Shift+Arrows to select the “colums” you want to move:

Screenshot of selecting columns

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.

Screenshot of dragging columns

6. Select all the text and use Sort Lines Lexicographically Ascending:

Screenshot of sorting lines alphabetically
Click Edit → Line Operations → Sort Lines Lexicographically Ascending

7. We have now sorted the text alphabetically by the first “columns”:

Screenshot of lines sorted alphabetically


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, and chronic volunteer. She loves data and coding, as well as teaching and sharing knowledge - oh, and sci-fi, chocolate, coffee, and cats :)


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. Be kind to each other. Thanks!

Very useful for a quick reorder and to view a csv in column mode.


Thank you, nice trick.

This made me fall in love with notepad++

I have the same need, more or less. But the text I have to work with is already tabbed, and the columns may vary in length (e.g. the text in line 1, field A is longer than the one in line 2, field A: that results in line 1, field B to be “one tab further” than line 2, field B – so that it’s impossible to exactly select “the columns to move”. Any suggestion on how to do that?

(I know my explanation is terrible, I can send you the text I’m working with if needed)

I think I understand what you mean, and I will attempt to explain how I solve that kind of problem. (If my explanation is not good enough or I misunderstood you, please feel free to e-mail me your example.)

If the character that separates your “columns” is a tab, you won’t be able to line up multiple lines by using the tab character. There are a couple of different ways you can get around this, you will just have to experiment to find the solution that works best for you. Basically you will have to manipulate the separator, then do the editing, then manipulate the separator again:

1. Replace all tabs with a tab and a second character, for example a vertical line.
2. Line up multiple lines by the second character. You will now have equally sized “columns” that you can move.
3. Replace all tabs plus the second character with a single tab, or whatever else you need to use as the separator

1. Replace all tabs with a whole bunch of tabs so you’re sure that there is enough whitespace between each “column”
2. The columns are not aligned, but you will be able to select one column at the time
3. Replace all tabs with a single tab, or whatever else you need to use as the separator

It worked like a charm, thank you so much!

Hi Catherine, first of all, I am new to Notepad++. Like in Seans comment, my data is already separated by tabs. I tried both of the solutions you described afterwards, but they did not work out. I tried different plugins, and they are not helping either :(

thank you so much, it worked perfectly :)

Thank you for that.
There is an issue with a single line, though.

A single line CSV cannot be ordered that way. It’s not a huge issue, but I’m still waiting for a “no exception” solution to this.

VERY helpful. Thanks!

Great tutorial, but I have a csv with more than 100.000 rows… there is a way to use ALT+SHIFT and go to the last row quickly? (I tried ALT+SHIFT+CTRL+END but it doesnt work :(

You can’t do it with keyboard commands (that I know of), but you can do it a different way. Put your cursor on the first line in your file, in the column you want the column selection to start, say column 12. Then use your mouse to drag the scrollbar to the bottom. Scroll right or left until the other side of your column select is in view. Now, Alt-Shift-left-click in that column and it will select from the first row to the row you clicked in.

Thank you very much Scott. It worked (with Alt-Shift-leftclick) !!!

You’re very welcome. Notepad++ is amazing, but does have its idiosyncrasies.


Great post, thanks! Ever run into a memory error? I tried this on a file with about 50k records, but “not enough memory.” Thought I’d see if you ever ran into the same. Thanks again!

Hi Catherine, Thanks much for this very practical site. I have a question that’s been plaguing me for some time concerning multiple column editing…How do you move data up or down in a column without moving data in an adjacent column. I tried everything. I know how to move a line or multiple lines of text with Shift+CTRL, but I only want to move data in a particular column without affecting adjacent columns. Thanks in advance. ~ Sean.

Hi Sean, I’m not sure this is even possible, at least I haven’t found a way to do it in Notepad++ yet. Maybe some of my other readers know how to achieve this? (This is the kind of task I use Excel for, since Excel is built for working with rows, columns and cells.)

Hi, Catherine and Sean. A bit late, but Notepad++ has a “column mode” editing, see here:

It’s far from perfect, but maybe you can can use that to achieve what you want.

if there is a ‘ (apostrophe) somewhere in the line, the line up doesn’t seem to work. Is it a known bug ?

I don’t know if it’s a known bug, you’d have to ask the Notepad++ author about that, but I’ve also had problems with apostrophes and slashes. Sometimes it works if you escape the characters (like adding another slash), other times I have simply replaced the characters with something else and then replaced it with the original value afterwards. It’s not the most perfect solution, but it’s usually quicker than other methods :)

Hi Cathrine,

I found out the “Line up multiple lines by (Clipboard Character)’, reformatting my csv file into readable columns. It works fine wit one file at a time, but I have to reformat a few hundred files. Can I do this reformatting with TextFX in one action over all open files?

@P, here is a method for aligning columns in a file that uses Regex replace in any editor. It does require a little footwork since you have to specify the alignment columns (where textfx dynamically calculates the best alignment column) but it can be used in many files, and you can save it off to use later.

• First, replace all commas with 50 spaces (however many you need to guarantee the commas are in free columns) followed by a comma. This is only to give you space to work.
• Now, we must choose the column we want for the first comma, say column 50, then the column for the second comma, and continue until we have defined a match for each comma. So, we create a regular expression to do this, like:
o ^([^,]{50,50})( *,)([^,]{15,15})( *,)(.+)$
o This grabs the first 50 non-comma characters and creates a group out of them,
o the second group is the extra spaces we need to remove in each line followed by a comma,
o the third group is the next 15 non-comma characters,
o the fourth group is again the extra spaces we need to remove,
o the fifth group is everything else.
• The replace string for this regex is:
o 1,3,5
o This pastes in the first, third, and fifth columns with commas inbetween (effectively deleting the blocks of spaces you don’t want, resulting in aligned characters).
• A good way to test this is to use one of the regex web sites, paste in part of one file.
• Now all you have to do is tell notepad++ to run this replacement in all opened documents.

To clarify, I should have said to replace all commas with 50 spaces plus the original comma, so you would run a replace in all files for “,” to ” ,”. I don’t know if that second string will display properly, but it’s 50 space characters followed by a comma.

One more clarification, if you want the commas in each group to be before the spaces rather than after do a search and replace of “( +),” with “,1”. This matches all spaces before a comma, and pastes in as a comma followed by the exact spaces that were there before, so your columns remain lined up, but the commas are moved.

Also, if it wasn’t clear, you would duplicate the groupings for all available columns and do the replace of all of them at once. This is assuming that all of your files share the same number of columns and can be processed with the same column widths. You could encapsulate this whole thing in a macro as well, if you are going to edit many files over time with this same structure (Catherine has blog entries to help with that).

thanks for this helpfully hint! Saves a lot of time and reduce some confusion with some files I have to deal.

Thanks a lot Cathrine! How many years I did that manually in Notepad++ and lost a lot of time, and now one google later I landed on that page and it does exactly what I needed, just great!

In SQL you always have “AS columnName”, which doesn’t seem to work with TextFX, because it’s more than one character. In that case I found “code alignment” where you can specify “Align by ..” and then you type your ” AS “. Works perfectly good as well.
Here the link I found that lead me to this Plugin:

Thanks nice tips and helpfull

What a brilliant blog! How you fit the rest of life in around all the work you do beats me. But thank you very much for spurring my interest in trying to be the best at ‘some little helpful things’ in my office. :)

Thanks for sharing! For some reason the regex in the post doesn’t work on my Notepad++. The regex I used is \s*\| instead of +|\
All other instructions worked perfectly.

Second time in a day that I ended up here, and second time that it was the perfect answer to my question!

Thank you very much!

Few people try to present the use of the plugin in such a simple way based on examples. I’m here for the first time at your place at , and probably .05.2019 not the last one because a lot of learning in front of me.

Hi..I am facing one issue asked on many forums but not get any solution as per my need..the question is “data range filtering on column” in notepad++ as we easily do in excel.. (is there any regex..can also solve my problem)my work format support .txt…like notpad,, is there any option to set range filtering on column to find and edit the required data… whole work stuck bcs of this option..thanks

So, the plugin only works with the 32-bit version. Anyone have an alternative that works with the 64-bit version?

I’m not technical, my notepad in windows 10 doesn’t have all the columns you show. i am interested in alphabetically sorting a txt file.

Thanks in advance if you can help.

PS, smart & cute awesome combination, btw I’m 76 years old. jsyk

Hi Randell, you need to downloade Notepad++. Please mark the ++ on the end. It is not de Notepad in Windows 10. Cheers.

How can we undo this action. >> 3. We have now lined up the text using the pipe (|) character to make it look like a table with columns:

Click Undo :)

I know it :) I saved the file. I turned it off and turned it on again. Can I cancel the alignment?

TextFX plugin doesn’t seem to be available in the current Notepad++… if it’s already been rolled up into Notepad++ by default, then I’m not seeing what the equivalent option to do what you’re describing is in the menus.

Hi Catherine. Thank you for more info on utilizing columns. However, I have a question that perhaps you could help me with. So, I have multiple columns, and I would like to be able to move a row up/down in a selected column without moving the row up/down in an adjacent column. This seems such a rudimentary feature, is there a way to do this?

Hi Brian, I’m not Catherine, but this is easy with column selections. Just use the clipboard. If your data is very ragged (meaning the not every row has data in the column you are selecting), then what I would do first (in NP++ since it’s column selections are not as robust as some other editors) is make a column selection on every row past the longest row (say in column 255) and insert a space. This will force all ragged rows to have spaces in every column up to the one selected, instead of nothing. Then make the column selection you want, cut it to the clipboard, move the cursor down/up the necessary number of rows, then paste the cut data. Now, if you need to get rid of the added spaces use search and replace with regular expressions to remove all spaces at the end of a row (google that and you’ll find examples). Hope that helps.

Hi Cathrine

I am getting access denied message when converting to table. Do you have any idea on this??

Sample Text
= Hello = 1 =
= Welcome = 2 =


Hi! This is Cathrine (again). Just a reminder. 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. Be kind to each other. Thanks!

Leave a Reply to GersonFuentes Cancel reply