Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Insertion of the leading zeros

    Help wanted · · · – – – · · ·
    2
    3
    4456
    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.
    • AndyOldShoe
      AndyOldShoe last edited by

      Hello.
      I’ve got a little misunderstanding. There is a text file with such kind of list:
      131_1.txt different symbols
      131_2.txt different symbols
      131_3.txt different symbols
      …
      131_10.txt different symbols
      …
      131_100.txt different symbols
      …
      131_1000.txt different symbols

      I have to insert leading zeros after prefics to get this kind of the list:
      131_0001.txt different symbols
      131_0002.txt different symbols
      131_0003.txt different symbols
      …
      131_0010.txt different symbols
      …
      131_0100.txt different symbols
      …
      131_1000.txt different symbols

      Is there an opportunity to perform it using Notepad++? I can find string “131_1.txt” with regular expressions, but I don’t know how to replace or just insert zeroes.
      I can do it manually with vertical blocks, of course, but it’s interesting to do it automatically )

      Scott Sumner 1 Reply Last reply Reply Quote 0
      • Scott Sumner
        Scott Sumner @AndyOldShoe last edited by

        @AndyOldShoe

        This thread will have information to help you in this task: https://notepad-plus-plus.org/community/topic/13988/find-replace-issues

        Since you have experience with regular expressions I will not do it for you, but will rather leave you to it! :-)

        1 Reply Last reply Reply Quote 1
        • AndyOldShoe
          AndyOldShoe last edited by

          Brilliantly, it works! Thank you so much)

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors