Skip to content

The Automated File Sorter is a Python script that organizes files in a specified directory by categorizing them into folders based on their file extensions (.xlsx, .png, .pdf, .txt). It automatically creates folders, sorts files into the appropriate directories, and handles unsupported extensions with error messages.

Notifications You must be signed in to change notification settings

katrina-maestro/Python_File_Sorter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Python_File_Sorter

Project Description: Automated File Sorter in File Explorer

Project Overview:

The Automated File Sorter is a Python script designed to organize files within a specified directory by categorizing them into folders based on their file extensions. This project aims to streamline the process of sorting and organizing files, making it easier to manage and access different types of documents.

Key Features:

  1. Automatic Folder Creation: The script automatically creates folders for different file types if they do not already exist.
  2. File Sorting: It moves files into their respective folders based on their extensions (.xlsx, .png, .pdf, .txt).
  3. Error Handling: The script handles files with unrecognized or unsupported extensions, providing feedback on such occurrences.

Project Structure:

  • Main Directory Path: The script operates within a specified directory, identified by the variable path.
  • File Identification: The script lists all files in the directory and identifies their extensions.
  • Folder Names: A predefined list of folder names corresponding to different file types is created.
  • File Movement: Using the shutil module, files are moved from the main directory to their respective folders.

How It Works:

  1. Initialize Directory and File List: The script starts by specifying the directory path and listing all files within that directory.

  2. Create Folders: It then checks if the necessary folders for organizing files exist. If not, it creates them.

  3. Sort Files into Folders: The script iterates through each file and moves it to the corresponding folder based on its extension.

  4. Error Handling: For files with unsupported extensions or already sorted files, the script outputs a message indicating that the file could not be moved.

Usage:

  1. Setup:

    • Ensure Python is installed on your system.
    • Place the script in the desired directory.
    • Modify the path variable to point to the target directory.
  2. Execution:

    • Run the script using a Python interpreter.
    • The script will automatically create the necessary folders and sort the files.

Benefits:

  • Efficiency: Saves time by automating the file organization process.
  • Organization: Keeps directories clean and organized, making file retrieval easier.
  • Customization: Can be easily modified to support additional file types or different directory structures.

This Automated File Sorter script is a simple yet effective tool for maintaining an organized file system, especially useful for users who frequently handle a variety of file types.

About

The Automated File Sorter is a Python script that organizes files in a specified directory by categorizing them into folders based on their file extensions (.xlsx, .png, .pdf, .txt). It automatically creates folders, sorts files into the appropriate directories, and handles unsupported extensions with error messages.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published