Sorry, here is the code, in tags. It seems the for loop will run once for row_ID and once for row hence the double entry in my CSV file. Maybe I'm wrong about why this is happening but it is happening. I have tried variations to fix it but to no avail. You will note that the two numbers do start at different points (as below, one starts at 60000 and the other at 700000). Thank you again for your help!
with open(in_file, 'r') as in_f, open(out_file, 'w', newline='') as out_f: rdr = csv.DictReader(in_f) fieldnames = ['Purchase Order Number', 'Purchases Transaction ID Number'] fieldnames.extend(rdr.fieldnames) wrtr = csv.DictWriter(out_f, fieldnames=fieldnames) wrtr.writeheader() for row_id, row in enumerate(rdr, start=1): row['Purchase Order Number'] = '{:0>7}'.format(row_id + 60000) row['Purchases Transaction ID Number'] = '{:0>6}'.format(row_id + 700000) wrtr.writerow(row)