简体   繁体   English

python xlrd:将excel文件转换为csv时如何删除引号

[英]python xlrd: how to remove quotation marks when converting excel file to csv

I used this method xls to csv converter to convert excel files(xls and xlsx) to csv files. 我使用这种方法xls到csv转换器将excel文件(xls和xlsx)转换为csv文件。 But when converting to csv files, it adds " " to each cell. 但是当转换为csv文件时,它会为每个单元格添加" "

Now, my question is how to remove the quotation marks when converting. 现在,我的问题是如何在转换时删除引号。

Set the CSV writer's quoting argument to whichever of the csv module's quoting constants has the behavior you want. 将CSV编写器的quoting参数设置为csv模块的引用常量中具有所需行为的参数。

http://docs.python.org/2/library/csv.html#csv.QUOTE_ALL http://docs.python.org/2/library/csv.html#csv.QUOTE_ALL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM