Page 1 of 1

Padding numbers

Posted: Wed Jun 07, 2023 12:06 am
by ebulerdo
I have a list with files whose names contain a number. This number can be two, three or four digits. I need to convert that number in four digits, adding zeroes to the left if necessary.

For example, I need to convert IMG_560.jpg into JPG0560. Actually it's a bit more complex but this is the core of the issue.

So far I am doing it in three steps, once for two digit numbers, then three digit, then four digit. Is there a way to convert them all at once?

Thanks!