Community
    • Login

    Change a series of numbers when they start with 2

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 2 Posters 881 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.
    • massimo la terraM Offline
      massimo la terra
      last edited by

      I would like to open a file, Notepad ++,
      When the series of numbers begins with 2, it takes into account the next 6 digits
      example original txt
      2230090048707,2
      2916220064167,2
      2031270035247,2
      2030330087752,2
      Final results
      230090,2
      916220,2
      031270,2
      030330,2

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @massimo la terra
        last edited by

        @massimo-la-terra

        Try:

        Find what box: 2(\d{6})\d*
        Replace with box: \1
        Wrap around checkbox: ticked
        Search mode radiobutton: Regular expression
        Press the Replace All button

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

          Ach, somehow missed copying the ^.

          Find-what expression should be ^2(\d{6})\d*

          massimo la terraM 1 Reply Last reply Reply Quote 2
          • massimo la terraM Offline
            massimo la terra
            last edited by

            it works perfectly, can I turn it into a rule?

            1 Reply Last reply Reply Quote 0
            • massimo la terraM Offline
              massimo la terra @Alan Kilborn
              last edited by

              @Alan-Kilborn Cattura.PNG Cattura2.PNG
              In the second line there is the problem

              Alan KilbornA 1 Reply Last reply Reply Quote 0
              • Alan KilbornA Offline
                Alan Kilborn @massimo la terra
                last edited by

                @massimo-la-terra

                In the second line there is the problem

                See if you can figure out where your original specification went wrong.
                Then see if you can figure out which part of the solution I gave you needs to change to make your new data work.

                can I turn it into a rule?

                If you mean to make a macro out of it, then the answer is yes. See the Macro menu for how to record and save a macro.

                1 Reply Last reply Reply Quote 2
                • massimo la terraM Offline
                  massimo la terra
                  last edited by

                  ok grazie ;-)

                  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