I have 2 directories with multiple files(read as CSV). The filename denotes a particular customer number. I read the files as follows,
for dirpath, dirs, files in os.walk("/path/to/file/"):
for file in files:
directory1(os.path.join(dirpath, file))
I read these files as CSV.
If a directory2 filename(file) matches a filename in directory1 then I want to append the data together as one file.
If the filename(file) is not present in directory1 then copy the data as it is.
This new files should be saved to a new directory.