I'm using notepad++ and I'm wasting time aligning my columns, is there a way to go from this:

hello    a   blabla
world!     b blabla
asda    c    blabla
fasda     d  blabla

To this:

hello   a   blabla
world!  b   blabla
asda    c   blabla
fasda   d   blabla

(I care for the lefthand space column, after I apply the script(?) to the left I can apply it to the right also)

I know I can select multiple columns but when I select a column straight down, can I use something to automate the aligning process?

  • 1
    Is it ok if it is work around using Excel? are there only three columns or is this just an example. We can use excel MID command to extract all the text into different columns.
    – Prasanna
    Oct 10 '14 at 20:57
  • I would waste more time that way :S (the only way would be if notepad++ opened excel, gave the data and returned the result --> overkill :D ) Oct 10 '14 at 21:04
  • then it would not worth writing formula in excel and stuff. wondering if there could be a regualar expression to replace the space or tabs in a given line with one single comma. Then we can replace the comma with tag. Notepad++ supports REGEX but i have no idea to achieve this
    – Prasanna
    Oct 10 '14 at 21:08

After you type out 'hello', push tab once instead of space a bunch of times, type 'a'. Then if the next word is 'bad' instead of 'world'(shorter than hello), when you push tab it'll line up with the end of 'hello', if you push tab again it'll align right with 'a'. If the next word is longer than 'hello' you can just push tab once to align with 'a'. This is how it works in sublime text anyway, which I personally prefer over notepad++.

  • I avoid tabs since they cause trouble. I updated the example because the problem doesn't happen on-the-fly but after. I want to insert various things (I use the systemverilog language). Oct 10 '14 at 20:43
  • ad SublimeText - it might be better but is different league - it is paid software
    – miroxlav
    Oct 16 '14 at 21:20

Notepad++ has a plugin, TextFX, http://tomaslind.net/2016/02/18/how-to-align-columns-in-notepad/, which will do this for you. Once you install it via the Plugin Manager, it will appear as a toolbar option. Copy the delimiter character to clipboard Ctrl+C, select the text Ctrl+A, and select TextFX -> TextFX Edit -> Line up multiple lines by (Clipboard Character), to for the selection to align


In SynWrite editor -

  • call some lexer (e.g. C++) so it considers words as tokens
  • select needed lines to align
  • call Commands dialog (Alt+P), search for command "Align tokens", run it

It aligns all tokens (not only words).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.