Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Delete spaces not followed by characters

    Help wanted · · · – – – · · ·
    2
    5
    60
    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
      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 Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        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
          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 Kilborn 1 Reply Last reply Reply Quote 0
          • Alan Kilborn
            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
              Galizza1 @Alan Kilborn last edited by

              @Alan-Kilborn

              This one works perfectly

              Thanks again for your help !!

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              Copyright © 2014 NodeBB Forums | Contributors