Python CSV : field containing quotation mark at the beginning

馋奶兔 提交于 2019-12-05 20:16:03

By default " is the quoting character of Python's csv module. Use

csv.reader(open('.info.csv'), skipinitialspace=True, quotechar=None)

to disable this default. The example you gave will result in the record

['test', '"test', '"test', 'test', 'test', 'test']

You can add the quoting=csv.QUOTE_NONE argument to reader()

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!