Could any of you help me with a problem I have with a lot of files with the same name, placed in sperate folders.
The folders are named with numbers, but the files inside are named index.XXXX – where XXXX could be .jpg or .html or .pdf.
I would like to make a 'program' that can rename all the 'index' files to the same name as the folder they are placed in.
The folders are named with 6 digit numbers – all different.
After this hopefully has been done, then I would like to move all the renamed files to a new single folder, so it will be easier for me to see the whole content.
Looking forward to reading your answers.
How to rename files in folders to foldername using batch file
batch-filedirectoryfilemoverename
Related Topic
- Python – How to copy a file in Python
- Javascript – How to include a JavaScript file in another JavaScript file
- Ruby-on-rails – Rails: How to rename a database column in a Ruby on Rails migration
- Python – How to list all files of a directory
- C# – Rename a file in C#
- Linux – How to change permissions for a folder and its subfolders/files in one step
- Python – How to delete a file or folder in Python
- Linux – How to find all files containing specific text on Linux
Best Answer
Tested folder structure:
Output: