When you execute the project, you provide the path to the folder you want to organize as an argument.
The program will:
- Traverse through all the files in the folder.
- Create a subfolder for each file extension (e.g., '.txt', '.jpg').
- Move files into their respective subfolders.
- If a file has no extension, it will be placed in a 'MISC' folder.
Before organizing:
MessyFolder/
├── file1.txt
├── file2.jpg
├── file3
├── notes.txt
├── image.png
After organizing:
MessyFolder/
├── TXT/
│ ├── file1.txt
│ ├── notes.txt
├── JPG/
│ ├── file2.jpg
├── PNG/
│ ├── image.png
├── MISC/
│ ├── file3
First, clone the repository:
git clone github.com/felipemdutra/folder-organizer.git
cd folder-organizer
Build the project:
go build .
Then type the path to the folder you want to organize as an argument for the executable, for example:
./folder-organizer ~/ExampleFolder/MessyFolder
In this example, "MessyFolder" is going to be organized.