How to read a CSV File delimited by '\x01' and create a dictionary in python

前端 未结 2 1682
醉酒成梦
醉酒成梦 2021-01-29 08:00

I have a requirement to read a CSV file which is \\x01 (^A) delimited and create a dictionary for my lookup for processing my business logic further. My input file

2条回答
  •  误落风尘
    2021-01-29 08:07

    You can try to set the delimiter='\x01'in the DictReader:

    lake_dataset = csv.DictReader(open(local_registry_file_path+os.path.basename(registryPath),'rb'), delimiter='\x01')
    

提交回复
热议问题