I am trying to add a few new columns with fixed values to the csv using python but the all the values are squeezed into one cell instead of separate cells. How to fix this?
My python code:
default_text = 'AoE'
with open('C:/Users/username/Desktop/Output/AoE_test.csv', 'r', newline='') as read_obj, \
open('C:/Users/username/Desktop/Output/output_1.csv', 'w', newline='') as write_obj:
csv_reader = reader(read_obj, delimiter=',')
csv_writer = writer(write_obj, delimiter=',')
for row in csv_reader:
row.append(default_text)
csv_writer.writerow(row)
This is the orginal CSV (AoE_test.csv) which the code reads data from:

This is the final output of the csv (output_1.csv) written with the data:

I've also tried to comment out the row.append():
for row in csv_reader:
# row.append(default_text)
csv_writer.writerow((row, default_text))
and the output:
I want the addtional column to be written in a separate column in CSV file. Thanks so much in advance!

default_text = 'AoE' with open('C:/Users/username/Desktop/Output/AoE_test.csv', 'r', newline='') as read_obj, \ open('C:/Users/username/Desktop/Output/output_1.csv', 'w', newline='') as write_obj: csv_reader = reader(read_obj, delimiter=',') csv_writer = writer(write_obj, delimiter=',') for row in csv_reader: row.append(default_text) csv_writer.writerow(row)