This is a script i have. 
"""
import os
from datetime import datetime, timedelta

def sanitize_path(input_path):
    """
    Removes surrounding quotes from the input path if present.
    """
    return input_path.strip('"').strip("'")

def extract_info(file_path):
    """
    Extracts the municipality and date information from both the file content and file name.
    """
    # Start by assuming the filename contains backup info
    filename = os.path.basename(file_path)
    filename_parts = filename.split('_')
    municipality_from_filename = filename_parts[0]
    date_from_filename = filename_parts[-1].split('.')[0]  # Strip extension and any other text

    # Format the extracted date from filename
    if len(date_from_filename) == 6:
        date_from_filename = f"{date_from_filename[:2]}-{date_from_filename[2:4]}-20{date_from_filename[4:]}"

    # Extract from file content
    with open(file_path, 'r') as file:
        first_line = file.readline().strip()
    
    parts = first_line.split()
    if len(parts) == 4:  # Assuming a consistent format
        municipality_from_content = parts[0]
        date_str_from_content = f"{parts[1]}-{parts[2]}-{parts[3]}"
    else:
        municipality_from_content = None
        date_str_from_content = None
        print(f"⚠️ Note: Unable to parse both municipality and date directly from file content. Using defaults from filename.")

    # Determine which to use
    municipality = municipality_from_content or municipality_from_filename
    date_str = date_str_from_content or date_from_filename

    try:
        datetime.strptime(date_str, "%d-%m-%Y")
    except ValueError:
        raise ValueError(f"Identified string '{date_str}' is not a valid date.")

    return municipality, date_str

def create_run_subfolders(date_folder_path, num_runs):
    """
    Creates subfolders named R1, R2, ..., RN inside the given date folder.
    """
    for i in range(1, num_runs + 1):
        run_folder_path = os.path.join(date_folder_path, f"R{i}")
        os.makedirs(run_folder_path, exist_ok=True)
        print(f"📂 Created run subfolder: {run_folder_path}")

def create_main_and_geo_subfolders(main_folder_path, dates, runs_per_date):
    """
    Creates the GEO subfolder structure with date subfolders and RUN folders.
    """
    geo_folder_path = os.path.join(main_folder_path, "GEO")
    os.makedirs(geo_folder_path, exist_ok=True)
    print(f"📂 Created GEO folder: {geo_folder_path}")

    for date_str, num_runs in zip(dates, runs_per_date):
        date_folder_path = os.path.join(main_folder_path, date_str)
        os.makedirs(date_folder_path, exist_ok=True)
        print(f"📂 Created date subfolder: {date_folder_path}")
        create_run_subfolders(date_folder_path, num_runs)

        geo_date_folder_path = os.path.join(geo_folder_path, date_str)
        os.makedirs(geo_date_folder_path, exist_ok=True)
        print(f"📂 Created GEO date subfolder: {geo_date_folder_path}")
        create_run_subfolders(geo_date_folder_path, num_runs)

def create_additional_subfolders(main_folder_path):
    """
    Creates additional subfolders: ZIP, TRAJ, TXT, DXF, LAS.
    """
    subfolders = ["ZIP", "TRAJ", "TXT", "DXF", "LAS"]
    for folder_name in subfolders:
        folder_path = os.path.join(main_folder_path, folder_name)
        os.makedirs(folder_path, exist_ok=True)
        print(f"📂 Created {folder_name} folder: {folder_path}")

def create_folder_structure(municipality, dates, runs_per_date):
    """
    Creates the folder structure on the desktop.
    """
    desktop_path = os.path.join(os.path.expanduser("~"), "Desktop")
    main_folder_path = os.path.join(desktop_path, municipality)

    try:
        os.makedirs(main_folder_path, exist_ok=True)
        print(f"✅ Created main folder: {main_folder_path}")

        create_main_and_geo_subfolders(main_folder_path, dates, runs_per_date)
        create_additional_subfolders(main_folder_path)

    except Exception as e:
        print(f"❌ Error creating folders: {e}")

def main():
    file_path = input("Enter the path to the .txt file (in quotes if needed): ").strip()
    sanitized_path = sanitize_path(file_path)
    
    if not os.path.isfile(sanitized_path):
        print("❗ The specified path is not a valid file.")
        return

    try:
        municipality, initial_date_str = extract_info(sanitized_path)
        print(f"Municipality: {municipality}, Date: {initial_date_str}")
    except ValueError as e:
        print(f"❗ Error reading file: {e}")
        return

    additional_days_input = input("Enter any additional days for folders within the same month and year (comma-separated): ").strip()
    additional_dates = []
    runs_per_date = []

    # Convert initial date to datetime object for reference
    initial_date = datetime.strptime(initial_date_str, "%d-%m-%Y")

    if additional_days_input:
        extra_days_str = additional_days_input.split(',')
        for day in extra_days_str:
            day = day.strip()
            try:
                # Only change the day, keep the same month and year
                new_date = initial_date.replace(day=int(day))
                date_str = new_date.strftime("%d-%m-%Y")
                additional_dates.append(date_str)
            except ValueError:
                print(f"❗ Invalid day entered: '{day}'. Please enter valid day numbers for the current month/year.")

    # Always include the initial date
    all_dates = [initial_date_str] + additional_dates

    # Prompt for number of 'R' folders for each date
    for date in all_dates:
        try:
            num_runs = int(input(f"Enter the number of 'R' subfolders for {date} (e.g., 3 for R1, R2, R3): ").strip())
            runs_per_date.append(num_runs)
        except ValueError:
            print(f"❗ Please enter a valid number for 'R' subfolders for {date}. Defaulting to 0.")
            runs_per_date.append(0)

    create_folder_structure(municipality, all_dates, runs_per_date)

if __name__ == "__main__":
    main()
"""