avoid accessing wrong column in csv

Avoid accessing wrong column in csv I was parsing few csv files. All were from same provider. Format isDate, Name, Email, Company, City etc in one file. I made an assumption all the downloaded files are in the same format. For my surprise few files had same format and others din’t. with open(filename, 'rb') as f: reader = csv.reader(f) reader.next() # first row contains column names for row in reader: name, email, company = row[1], row[2], row[3] #save to db In the above code the fundamental mistake is fixing the position of the columns in csv file. [Read More]
csv  python  tip