Page 1 of 1

numbered files minimum digits

PostPosted: Sat Nov 11, 2017 6:41 am
by jayhova
I'm attempting to make my audiobook files so they will order correctly. However, I have a problem many of the files are not padded correctly. is there a way to fix this. These files came like this.

short_science_fiction_collection_038_1007_librivox.zip
short_science_fiction_collection_039_1008_librivox.zip
short_science_fiction_collection_19_0906_librivox_64kb_mp3.zip

Re: numbered files minimum digits

PostPosted: Sat Nov 11, 2017 3:09 pm
by KenP
I assume you want the first numbers increased to 3 digits ?

If that's what you want this will work, if you have any file names where the first number is just one digit you will need to run the code a second time.

RegEx (1)
Match: (.*_)(\d|\d{2})(_.*)
Replace: \10\2\3