I need to rename all the images as the title explains in all sub-folders. I'm thinking of extracting with regex the number inside the parenthesis then renaming it. Searching around I saw there are tools like rename
and mmv
but I couldn't get them to pad-rename the jpgs.
I'll appreciate any advise to tackle my problem.
BTW: is for Windows and I have cygwin bash and perl.
Edit:
Conclusions after experimenting with all the answers.
- Cygwin
rename
is not good, the one I could get to work doesn't accept regex, but definitely a nice option, e.g. by running a Linux VM and mounting a Win SharedFolder. - You can build a better
rename
tool for Cygwin with this shell script usingsed
. - The Windows equivalent for
pwd
is simplycd
. - Hugmeir posted a promising solution using Perl 5.13+ which are dev releases, but by the time you may be reading this, probably that will be stable.
- The pad_left sub may not be a better alternative to printf syntax, but it works.