I wanted to use a batch script to rename a bunch of files which are using the following name scheme:
File 2-9.pdf
File 3-9.pdf
File 4-9.pdf
[...]
I want to invert the numbers so that they will become...
File 9-2.pdf
File 9-3.pdf
File 9-4.pdf
[...]
Normally I would search for the repeating string and replace it, but in this case the string changes with each file, so I don't know how to go about it. Any ideas?
Thank you for reading.
EDIT: I am on Windows, I am seeking to create a .bat file. Something like
For %%# in ("file-path") Do (
Set "File=%%~nx#"
Ren "%%#" "!File:%Pattern%=%Replace%!"
)