Community
    • Login

    Cut the number of characters in all documents

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 2.7k Views 2 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.
    • StasS Offline
      Stas
      last edited by

      Hi!
      Please tell me how I can cut the number of characters in all txt documents?
      I have thousands of txt documents with different number of characters, but I need to leave for all of them only 500 characters. Thank you!

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS Offline
        Scott Sumner @Stas
        last edited by

        @Stas

        This sounds like a dangerous operation to me, so be sure you have a backup of all your files before beginning.

        You could try a Replace In Files operation:

        Find what:
        (?s).{500}\K.*

        Replace with:
        make sure this box is empty

        Search mode:
        Regular expression

        StasS 1 Reply Last reply Reply Quote 1
        • StasS Offline
          Stas @Scott Sumner
          last edited by

          @Scott-Sumner

          Thank you very much!

          Scott SumnerS 1 Reply Last reply Reply Quote 0
          • Scott SumnerS Offline
            Scott Sumner @Stas
            last edited by

            @Stas

            You replied very fast – did you try it? Did it work?

            StasS 1 Reply Last reply Reply Quote 0
            • StasS Offline
              Stas @Scott Sumner
              last edited by

              @Scott-Sumner said:

              (?s).{500}\K.*

              checked, it works!
              Thank you

              1 Reply Last reply Reply Quote 0

              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