How to align text to the right with notepad++?
15,853
I think you'll need two main steps here. In Notepad++, select Plugins -> Plugin Manager and check if the TextFX Characters plugin is installed.
Solution for use case 1
- Search for the longest line,
- set cursor to the end of the longest line,
- press and hold Alt,
- click left mouse button and move mouse to upper left corner,
- go to Menu TextFX > TextFX Edit > Pad rectangular selection with space,
- repeat steps for lower left corner (select empty last line too),
- save the file looking like upper left corner shown in the screenshot below.
Solution for use case 1 (continue)
- Ctrl+H
- Find what:
^(.+?)(\h+)
- Replace with:
\2\1
- check Wrap around
- check Regular expression
- Replace all
Solution for use case 2
Copy the character used as a delimiter ";" to the clipboard and select all rows.
Select TextFX -> TextFX Edit -> Line up multiple lines by (Clipboard Character):
Special use case 3
BTW - you may want to use Ctrl+Alt+R for viewing and writing right align and switch back by using Ctrl+Alt+L for left align.
Related videos on Youtube

Author by
flyingbird013
Updated on July 20, 2022Comments
-
flyingbird013 10 months
I have text like this:
1;a;3;; 2;abc;4;; 3;abcde;5;;
I want to align texts to the right with notepad++, so become like this:
1;a;3;; 2;abc;4;; 3;abcde;5;;
How to do this?
-
lsalamon almost 3 yearsCTRL+ALT+R and select all lines and SHIFT+TAB.....multiple times
-
Toto about 2 yearsWhere do you find
CodeWright
? A screenshot is welome.