Aug-01-2023, 11:42 PM
Hi everyone,
Many of us know we can rename multiple files with windows explorer following the steps here:
https://support.microsoft.com/en-us/topic/how-to-rename-multiple-files-in-windows-xp-with-windows-explorer-e0a7499f-6cd2-5147-3ce6-7748b6dd0dcb#:~:text=Select%20multiple%20files%20in%20a,name%2C%20and%20then%20press%20ENTER.
I have a folder that already contains many files named using the above way.
Now I need to delete some files in that folder. Instead of repeating the steps again manually, can I have a Python code to help me automatically update the names? For example, if there are 3 files named as: XYZ (1), XYZ (2) and XYZ (3). If XYZ (1) is deleted, I want the remaining two files to be renamed as XYZ (1) and XYZ (2) which reflects a new continuous order.
Many of us know we can rename multiple files with windows explorer following the steps here:
https://support.microsoft.com/en-us/topic/how-to-rename-multiple-files-in-windows-xp-with-windows-explorer-e0a7499f-6cd2-5147-3ce6-7748b6dd0dcb#:~:text=Select%20multiple%20files%20in%20a,name%2C%20and%20then%20press%20ENTER.
I have a folder that already contains many files named using the above way.
Now I need to delete some files in that folder. Instead of repeating the steps again manually, can I have a Python code to help me automatically update the names? For example, if there are 3 files named as: XYZ (1), XYZ (2) and XYZ (3). If XYZ (1) is deleted, I want the remaining two files to be renamed as XYZ (1) and XYZ (2) which reflects a new continuous order.