Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 FastCSV。
当我这样做时:
标题 = "\"" + some_title + "\""
我的文件看起来像:
"""some title """, 23, 22
我想:
"some title", 23,22
我的猜测是,fastcsv 正在添加额外的引号来转义输入字符串中的引号。因此,如果您输入的字符串是 [Hello, CSV],则更快的 csv 必须将其括在双引号中,以便 csv 解析不会被逗号中断。同样适用于在 CSV 中有意义的双引号。
我想说尝试发送不带引号的字符串,让 fastcsv 决定何时需要双引号或使用 Jacob 建议的单引号。