I am reading data from a CSV file (xyz.CSV) which contains below data:
col1,col2,col3,col4
name1,empId1,241682-27638-USD-CIGGNT ,1
name2,empId2,241682-27638-
Your first line only has one column, so the process fails and doesn't continue. To solve, just skip first row
>>> with open( path, "r") as file:
... reader = csv.reader(file)
... for idx,line in enumerate(reader):
... if idx>0:
... t=line[1],line[2]
... print t
...
('empId1', '241682-27638-USD-CIGGNT ')
('empId2', '241682-27638-USD-OCGGINT ')
('empId3', '241942-37190-USD-GGDIV ')
('empId4', '241942-37190-USD-CHYOF ')
('empId5', '241942-37190-USD-EQPL ')
('empId6', '241942-37190-USD-INT ')
('empId7', '242066-15343-USD-CYJOF ')
('empId8', '242066-15343-USD-CYJOF ')
('empId9', '242066-15343-USD-CYJOF ')
('empId10', '241942-37190-USD-GGDIV ')