Community
    • Login

    Delete spaces not followed by characters

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 1.4k 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.
    • G Offline
      Galizza1
      last edited by

      Hi, sometimes i find several lines on a document than only contain spaces, not followed by any text character.

      Is it possible to delete all this spaces but without deleting the lines that contain them nor modifying any other line that start with spaces followed by any character?

      Thank you very much !

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

        @Galizza1

        It isn’t your exact description, but you probably want this:

        5aebbfe2-bf4f-4648-99eb-807c1181bbae-image.png

        G 1 Reply Last reply Reply Quote 0
        • G Offline
          Galizza1 @Alan Kilborn
          last edited by

          @Alan-Kilborn

          Blank Operations > Trim Trailing Space  works ok with lines that only contain spaces, but it also deletes all spaces that exist after the last character of any sentence, and that’s something that i want to avoid.
          Thanks for your help !

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

            @Galizza1

            OK, then try this replace operation:

            Find: ^\h+?(?=\R)
            Replace: nothing
            Search mode: Regular expression

            G 1 Reply Last reply Reply Quote 1
            • G Offline
              Galizza1 @Alan Kilborn
              last edited by

              @Alan-Kilborn

              This one works perfectly

              Thanks again for your help !!

              1 Reply Last reply Reply Quote 1

              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