More details of issue on StackOverflow:
def collate_files(old_dir, new_dir) -> str:
for subfolder in old_dir.rglob('*.xlsx'):
if subfolder.match("string_title"):
new_dir= new_dir.joinpath(subfolder)
if Path.exists(new_dir):
pass
else:
try:
shutil.copy(subfolder, new_dir, follow_symlinks=True)
except OSError as e:
raise e
Top comments (0)