Community
    • Login

    Removing multiple blank lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 521 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Gerd SelterG
      Gerd Selter
      last edited by

      I am looking for a way to replace multiple consecutive blank lines with a single blank line via find/replace or macro. Unfortunately, I could not find anything about this anywhere and wonder if this is even possible.
      If someone has an idea about this, then always here with it :-)

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Gerd Selter
        last edited by

        @Gerd-Selter

        Find: ^(\R)+
        Replace: ${1}
        Search mode: Regular expression

        There are certainly other expressions that will do it as well.

        Gerd SelterG 1 Reply Last reply Reply Quote 3
        • Gerd SelterG
          Gerd Selter @Alan Kilborn
          last edited by

          @Alan-Kilborn Thanks, works great

          1 Reply Last reply Reply Quote 0
          • namx3249N
            namx3249
            last edited by

            and why don’t use command from Edit - Line operations - Remove empty lines ?

            you can also assign a keyboard letter for this command …

            Alan KilbornA 1 Reply Last reply Reply Quote 0
            • Alan KilbornA
              Alan Kilborn @namx3249
              last edited by

              @namx3249 said in Removing multiple blank lines:

              and why don’t use command from Edit - Line operations - Remove empty lines ?

              Because OP wanted a “single blank line” to remain after the operation.

              1 Reply Last reply Reply Quote 2
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors