i tried the following script as per ur suggestion and i get an error import csv
def main():
col_name = "\\xyz-abc\Procz(abcd)\Digital"
with open('C:\\read.csv', 'rb') as inf:
reader = csv.reader(inf)
col_index = next(reader).index(col_name)
highest = max(rec[col_index] for rec in reader)
print "test"
main()
I get an error ValueError: '\\\\xyz-abc\Procz(abcd)\Digital' is not in list please help me..
I think the script is not reading the column header.
col_nameisn't actually in the header. We need to see the first few lines of your csv file to determine if this is the case. I would also suggest trying to printnext(reader)to see what it's giving you.