Community
    • 登入

    Change a series of numbers when they start with 2

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    7 貼文 2 Posters 524 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • massimo la terraM
      massimo la terra
      最後由 編輯

      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 條回覆 最後回覆 回覆 引用 0
      • Alan KilbornA
        Alan Kilborn @massimo la terra
        最後由 編輯

        @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 條回覆 最後回覆 回覆 引用 2
        • Alan KilbornA
          Alan Kilborn @Alan Kilborn
          最後由 編輯

          Ach, somehow missed copying the ^.

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

          massimo la terraM 1 條回覆 最後回覆 回覆 引用 2
          • massimo la terraM
            massimo la terra
            最後由 編輯

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

            1 條回覆 最後回覆 回覆 引用 0
            • massimo la terraM
              massimo la terra @Alan Kilborn
              最後由 編輯

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

              Alan KilbornA 1 條回覆 最後回覆 回覆 引用 0
              • Alan KilbornA
                Alan Kilborn @massimo la terra
                最後由 編輯

                @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 條回覆 最後回覆 回覆 引用 2
                • massimo la terraM
                  massimo la terra
                  最後由 編輯

                  ok grazie ;-)

                  1 條回覆 最後回覆 回覆 引用 0
                  • 第一個貼文
                    最後的貼文
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors