Community
    • Login

    Removing multiple blank lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 929 Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          Gerd Selter @Alan Kilborn
          last edited by

          @Alan-Kilborn Thanks, works great

          1 Reply Last reply Reply Quote 0
          • namx3249N Offline
            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 Offline
              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

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors