Search code examples
editornotepad++edittext-manipulation

Multiple-line collapse in Notepad++


I want to use notepad++ to do multiple-line collapse. What I mean is that I am looking for a simple operation to turn

1
2
3
4

into

1 2
3 4

Solution

  • How about:

    • Ctrl+H
    • Find what: (.+)\R(.+)(\R)
    • replace with: $1 $2$3
    • Replace all

    Where \R stands for any kind of linebreak.

    This will replace a linebreak between 2 lines by these 2 lines separated by a space.