I am trying to combine csv file into one as below mentioned
input1:
Name,Age,Department
Birla,52,Welding
Rob,45,Furnace
input2:
YearofService,Audit
14,Y
8,N
My expected output :
Name,Age,Department,YearofService,Audit
Birla,52,Welding,14,Y
Rob,45,Furnace,8,N
My code :
with open('input1.csv','r') as i,open('input2.csv','r') as o:
reader=csv.reader(i)
fieldnames=reader.fieldnames
reader1=csv.reader(o)
fieldnames_1=reader1.fieldnames
#here reading the fieldnames and combine csv file as 1:
I dont need to uuse python pandas.is that possible to achieve using csv library? help me on this. Instead of writing into sepearate ouput file,if its we ad the input to input1 is also fine