Reading data from a CSV file in Python

后端 未结 8 628
你的背包
你的背包 2020-11-28 16:36

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-         


        
8条回答
  •  佛祖请我去吃肉
    2020-11-28 17:14

    Hope it clears the issue

    import csv
    file=open( "xyz.CSV", "r")
    reader = csv.reader(file)
    for line in reader:
        t=line[0]+","+line[1]
        print (t)
    

提交回复
热议问题