Identify the number and replace it by counter
Posted: 05.10.2019, 17:46
Inspired by this topic and also because I needed to do this few times already, I suggest to add this feature, it would be useful to renames files like "file1", "file2"..."file 9", file 10", "file 11" to "file01"..."file 11":
Identify the number and replace it by counter [c] .
For example, the files with the names like this:
File1
File2
File3
...
File10
File11
File12
To this form (just add zero, so the number of digits will be the same in all files):
File01
File02
File03
...
File10
File11
File12
Image viewer XnView can do this - just remove numbers and replace them by any number of digits (using ## for 2 or ### for 3 digits), but it can't sort using "Natural sorting", so it's not possible to do it there either.
I tried to achieve it now using "1|2|3|4|5|6|7|8|9|0" in "Search for" and [n][c], but it doesn't work good.
Identify the number and replace it by counter [c] .
For example, the files with the names like this:
File1
File2
File3
...
File10
File11
File12
To this form (just add zero, so the number of digits will be the same in all files):
File01
File02
File03
...
File10
File11
File12
Image viewer XnView can do this - just remove numbers and replace them by any number of digits (using ## for 2 or ### for 3 digits), but it can't sort using "Natural sorting", so it's not possible to do it there either.
I tried to achieve it now using "1|2|3|4|5|6|7|8|9|0" in "Search for" and [n][c], but it doesn't work good.