11 Vote

Add leading Zeros to existing Numbers in File Names

Question by Mail Request | 2023-07-19 at 20:52

Many programs have problems sorting file names if they contain numbers. You can prevent this by using leading zeros.

Specifically, it's for example about file names like "1.jpg", "11.jpg" and "100.jpg", which I would like to rename to "001.jpg", "011.jpg" and "100.jpg". Depending on the length of the existing number, a different number of zeros should be added so that all numbers will have the same length after renaming.

How can I rename files this way?

1Best Answer1 Vote

For this you can use the function "Number Adjustment" of the FileRenamer, which you can find on the right side of the main window under "Changes" for both the file name and the file extension.

In the options of this function you can set the following:

  • Increment: Since we want to keep the numbers themselves unchanged, we set the increment to "0". This keeps the current numerical value and neither increases nor decreases it.
  • Leading Zeros: In this field we write the number of zeros we want. For your example, that would be "2".
  • Position: This field is relevant if there are multiple numbers within your filename and you only want to change certain of those numbers. "0" changes all numbers, "1" the first number from the front, "2" the second number from the front, "-1" the first number from the back (the last number), and so on. In your case, "0" would be the right choice here.

You can learn more about this topic in the tutorial on file numbering, specifically in the section on changing existing numberings.
2023-07-19 at 21:37

ReplyPositive Negative

Related Topics

Rename File to its Folder Name

Tutorial | 0 Comments

PHP: File Download Script

Tutorial | 0 Comments

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.


Ask your own question or write your own article on askingbox.com. That’s how it’s done.