This script organizes files based on their categories within a specified target directory. It creates a new directory [target_folder_name]_organized
in a more organized way.
THIS DOES NOT ALTERN the files to be sorted
- First, based on filenames, send files into given manually defined bins (preset: ['core', 'cover', 'logo'),
target_directory/
βββ target_directory_organized/
βββ core/
βββ cover/
βββ logo/
βββ other/
-within /other
, all files put into bins that share common first word. e.g ElecEngineer.stl
, ElecBox.stl
are put into the same dir Elec
Final dir tree
target_directory/
βββ target_directory_organized/
βββ core/
βββ cover/
βββ logo/
βββ other/
βββ A/
βββ B/
βββ C/
...
drop this file ONE directory above the directory you want to sort.
run
cd YOUR_STL_DIRECTORY; python PATH_TO_SCRIPT/file_organizer.py
drop this file ONE directory above the directory you want to sort.
run
python file_organizer.py -d [target_directory] -e [file_extension]
Arguments
-d
,--target_dir
: The path to the directory containing the files to be organized.-e
,--extension
: The file extension to organize. If not specified, all files will be organized.
Frank Hu [email protected]