Decrease fileNumber by 1
Posted: Fri Mar 19, 2021 3:08 am
Hello,
I have following files in a directory:
userNum1022.html
userNum1023.html
userNum1024.html
userNum1025.html
and so on.
I wish to rename them to
userNum1021.html
userNum1022.html
userNum1023.html
userNum1024.html
etc. That is, decrease the indent of each fileName by one.
How to go about doing this?
p.s. - previously, I had files userNum1.html to userNum2500.html in a single directory. Due to bad formatting, I had to delete a file in the middle, userNum1021.html. To rename the remaining files, I moved the rest of the files, userNum1022.html to userNum2500.html in a separate directory. It is in this directory that I am trying to reduce the indent by one, so that I can move the newly renamed files back to the original folder, where the serial order is maintained. If the renaming can be done in the original folder itself, please do let me know, as it will save the trouble of cut-paste and create new directory etc.
Thanks.
I have following files in a directory:
userNum1022.html
userNum1023.html
userNum1024.html
userNum1025.html
and so on.
I wish to rename them to
userNum1021.html
userNum1022.html
userNum1023.html
userNum1024.html
etc. That is, decrease the indent of each fileName by one.
How to go about doing this?
p.s. - previously, I had files userNum1.html to userNum2500.html in a single directory. Due to bad formatting, I had to delete a file in the middle, userNum1021.html. To rename the remaining files, I moved the rest of the files, userNum1022.html to userNum2500.html in a separate directory. It is in this directory that I am trying to reduce the indent by one, so that I can move the newly renamed files back to the original folder, where the serial order is maintained. If the renaming can be done in the original folder itself, please do let me know, as it will save the trouble of cut-paste and create new directory etc.
Thanks.