Dec-13-2021, 11:34 PM
Well, csv is just text and the files are identical in format.
The only problem I see is if you have headers, then the headers will appear twice with the below, but that can be dealt with easily.
I have a lot of csv files I use as answer keys for OMR.
The only problem I see is if you have headers, then the headers will appear twice with the below, but that can be dealt with easily.
I have a lot of csv files I use as answer keys for OMR.
import glob path2files = '/home/pedro/winter2021/OMR/20EAP/question_data_csv/' files = glob.glob(path2files + '*.csv') for file in files: print('The files are:', file) file1 = input('Copy and paste 1 of the above files here ... ') file2 = input('Copy and paste 1 of the above files here ... ') with open(file1) as data1, open(file2) as data2: string1 = data1.read() string2 = data2.read() amalgamate = string1 + string2 output = '/home/pedro/temp/output.csv' with open(output, 'w') as o: o.write(amalgamate) print('Only problem is the header row appears twice!')