I've two csv files to append & create a new csv file with the result. If I use 'binary' like 'rb' or 'wb' to read the write then it's throwing
_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
If I use only 'r' & 'w' to read & write the following code giving me error like
IndexError: list index out of range
with open('file1.csv','rt') as f, open('final.csv','wt')as out:
first=csv.reader(f)
final = csv.writer(out)
for row in first:
result=row[1]
final.writerow(result)
with open('file21.csv','rt') as s, open('final.csv','wt')as out:
second = csv.reader(s)
final = csv.writer(out)
for row in second:
result=row[1]
final.writerow(result)