Feb-13-2020, 10:31 AM
You need to translate the rows according to the plan, so replace the lines 77 to 88 by
fieldnames = [pair[0] for pair in plan] writer = csv.DictWriter(outfile, delimiter=';', fieldnames=fieldnames, extrasaction='ignore') headers = {n: n for n in writer.fieldnames} writer.writerow(headers) for row in reader: new_row = merge(plan, row) writer.writerow(new_row)