I have CSVs with matching names in two folders. They are unique i.e. for each record in Folder1, there is likely to be a matching record with same name in Folder2.
I would like to combine CSVs with matching names into one workbook as Worksheets within the Workbook. For example, if there exists 220001.csv in both Folder1 and Folder2, the resultant workbook would be 220001.xlsx in Folder3. If a similar named file is missing in Folder2, then the resultant .xlsx will just be with one worksheet i.e. the record in Folder1. Folder1 is the master folder sort of.
How do I solve this in Python?