I've seen people do this in Perl, but I'm wondering if there's a way to do it via batch? It's built into Windows, so I think it would be more useful to know how to do this with a batch script. It doesn't require installing anything onto a computer.
An example input name: myFile_55
An example output pattern: change myFile
to picture
and reduce the number by 13.
An example output: picture_42
.
How would you approach this? I know a batch command to rename:
ren myFile_55 picture_42
.
So, if I have a file named renamer.bat
, I can add the following:
for /r %%x in (%1) do ren "%%x" %2
.
Then I can type this command:
renamer.bat myfile* picture*
.
I don't know how to reduce the numbers, though.