I am trying to copy all .csv files within a parent folder and all sub-folders within, to a new destination ("C:/Projects/CSVFiles").
I have used the following code(from elsewhere on the forum) but this only copies the .csv files in the parent directory (DataFiles) and not from the sub-folders within /datafiles/.
Any advice appreciated. Thanks
import glob
import shutil
import os
src_dir = "C:/Projects/DataFiles"
dst_dir = "C:/Projects/CSVFiles"
for CSVfile in glob.iglob(os.path.join(src_dir, "*.csv")):
shutil.copy(Excelfile, dst_dir)