https://github.com/frayedfunction/file_sort
Simple script that organises files into respective folders.
https://github.com/frayedfunction/file_sort
filesort python scripts
Last synced: 7 months ago
JSON representation
Simple script that organises files into respective folders.
- Host: GitHub
- URL: https://github.com/frayedfunction/file_sort
- Owner: FrayedFunction
- Created: 2020-06-06T02:23:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-07T19:18:43.000Z (almost 6 years ago)
- Last Synced: 2025-08-15T13:35:23.580Z (8 months ago)
- Topics: filesort, python, scripts
- Language: Python
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# File_Sort
Simple script that organizes files into respective folders.
## How to use: Choose folder path
Enter the path of the folder you would like to organize as the value of the **folder_path** variable.
In order for the path to be found, the backslashes need to be inverted so it looks like the example path below:
folder_path = "C:/Users/exampleuser/Videos"
## How to use: Specify how the files should be organized
To specify how the script should organize the files and the name of the respective folder the file belongs in, edit the value of **file.split(' ')[0]** in the **"folder_name"** variable.
For example: if you have a folder full of photos and you want to organize them by year and they have file names such as:
2012-Family.jpg
2017-Dog.png
2017-Holiday.jpg
2012-Park.jpg
...
Set the **file split** value as:
file.split('-')[0]
The script will read the file names as far as the first '-' and it will create two folders, **2017** and **2012**. In these folders will be the corresponding files with the same value.
If you wanted to organize the file by month and the files were named as:
2012-12-Family.jpg
2017-08-Dog.png
2017-08-Holiday.jpg
2012-12-Park.jpg
...
Set the **file.split** value as:
file.split('-')[1]
and the script will organize the files as far as the second '-' so it will produce two folders, **08** and **12**. In these folders will be the corresponding files with the same value.