Community
    • Login

    How can I remove in a txt file all the spaces in each line after the last character?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 4 Posters 5.6k 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.
    • CletosC
      Cletos
      last edited by

      How can I remove in a txt file all the spaces in each line after the last character?

      E.g. in a txt file:
      1 A single line
      2 A single line with different lengths
      3 A single line with different lengths, characters

      So remove all spaces in the 1. line after the last “e”, in the 2. after the last “s” and in the 3. after the last “s”.

      andrecool-68A 1 Reply Last reply Reply Quote 0
      • andrecool-68A
        andrecool-68 @Cletos
        last edited by

        Imgur

        Alan KilbornA 1 Reply Last reply Reply Quote 3
        • guy038G
          guy038
          last edited by guy038

          Hello @cletos and All,

          I think that @andrecool-68 made a little mistake in his answer !

          From your post, you’ll have to perform the option :

          Edit > Blank Operations > Trim Trailing Space

          Best Regards,

          guy038

          1 Reply Last reply Reply Quote 3
          • Alan KilbornA
            Alan Kilborn @andrecool-68
            last edited by

            @andrecool-68

            With that solution, you’ve give the OP more than they’ve asked for. The better operation, to do only what was required, is this one:

            20cf8388-6583-4e8e-b8ce-e2a6714bbe2d-image.png

            1 Reply Last reply Reply Quote 4
            • CletosC
              Cletos
              last edited by

              Thank you, andrecool-68,

              Works great.

              Hello guy038,

              That option does it very good as well, thank you. Thanks Alan.

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