This Python script helps you sort files in a directory by their file extension. It creates folders named after the file extensions and moves the files into their respective folders. After sorting the files by their extension, the script also sorts the files alphabetically within each folder.
- Python 3.x
-
Place the
file_sorting_automation.py
script in the directory where you want to sort the files. -
Open a terminal or command prompt.
-
Navigate to the directory where the script is located.
-
Run the following command: python file_sorting_automation.py
-
The script will sort the files in the directory by their file extension and then sort them alphabetically within each folder.
- This script will only process files in the directory where it's located. It won't process files in subdirectories.
- The script will create folders based on the file extensions and move the files into those folders.
- The script will sort the files alphabetically within each folder and prepend a 3-digit index to the file names to maintain the alphabetical order.
This project is released under the MIT License. See the LICENSE
file for more information.