Sep-20-2023, 07:38 PM
Use Code tags.
Your description most have been basic and leaving out the 5000 part.
An other problem if don't know Python,then it can be hard to fix or suggest a update from ChatGPT.
Something like this and using pathlib
Your description most have been basic and leaving out the 5000 part.
An other problem if don't know Python,then it can be hard to fix or suggest a update from ChatGPT.
Something like this and using pathlib
from pathlib import Path import shutil dir_find = '5000' source_folder = Path("G:/div_code/Source") des_folder = Path("G:/div_code") des_subfolder = des_folder / dir_find for file in source_folder.glob(f"{dir_find}*"): # Create the des subfolder if it doesn't exist des_subfolder.mkdir(parents=True, exist_ok=True) des_file = des_subfolder / file.name # move file can also use .copy shutil.move(file, des_file)