我正在尝试读取包含如下行的 CSV 文件:
test,"test,"test,test,test,test
引号有问题(有六个字段,但它们被检索为五个字段,如“test”,test被读取为单个字段)。
我已尝试按如下方式修改条目,但仍然无法检索引号:
test,""test,""test,test,test,test # quotation marks disappear when the entry is read.
test,\"test,\"test,test,test,test # backslashes are also retrieved; escaping doesn't seem to work.
我正在以这种方式读取 CSV 文件:
info_source = csv.reader(open('.info.csv'), skipinitialspace=True)
for row in ling_info_source:
data = row[1].strip()
...