Community
    • Login

    Cut the number of characters in all documents

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

          @Scott-Sumner

          Thank you very much!

          Scott SumnerS 1 Reply Last reply Reply Quote 0
          • Scott SumnerS
            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
              Stas @Scott Sumner
              last edited by

              @Scott-Sumner said:

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

              checked, it works!
              Thank you

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