Extract and Delete Nested Folders

This script automates the extraction of files from nested folders and deletion of empty folders. It can be useful for organizing and flattening a directory structure that contains nested folders with files.

Instructions:

Follow these steps to use the script:

1. Prerequisites:

  • Ensure that you have Python installed on your machine.
  • Install the required modules by running the following command in your command prompt or terminal:

pip install shutil

2. Clone the repository:

  • Clone this repository to your local machine using the command:

git clone https://github.com/RanaShankani/extract_and_delete_folders.git ↗

3. Navigate to the repository:

  • Open a terminal or command prompt and navigate to the cloned repository directory:

cd extract_and_delete_folders

4. Open the script:

  • Open the script file, extract_and_delete_folders.py, in a text editor or integrated development environment (IDE) of your choice.

5. Specify the root folder:

  • In the script, locate the line that specifies the root_folder variable:

root_folder = "your_root_folder"

  • Replace the value of root_folder with the path to the root folder containing the nested folders you want to process. Make sure to use the appropriate path format for your operating system.

6. Save the script:

Save the changes you made to the script file.

7. Run the script:

  • Open a terminal or command prompt and navigate to the repository directory.
  • Execute the script by running the following command:

python main.py

8. Check the results:

  • After running the script, check the specified root_folder to see the extracted files and the deleted empty folders.

License

extract_and_delete_folders is licensed under the MIT License. See the LICENSE file for details.

Contributing

If you'd like to contribute to Extract and Delete Nested Folders, you can fork the repository and create a pull request with your changes. Please make sure to follow the contributing guidelines and adhere to the code of conduct.

Contact

If you have any questions or feedback, you can contact the project maintainer at rana.shk.nz@gmail.com