Insertion of the leading zeros



  • 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 )



  • @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! :-)



  • Brilliantly, it works! Thank you so much)


Log in to reply