Why is the Python CSV reader ignoring double-quoted fields?

前端 未结 2 777
说谎
说谎 2020-12-06 01:01

I think this is probably something simple, but after an hour of searching, I\'ve had no luck figuring out what I\'m doing wrong.

I\'m using the following code to rea

2条回答
  •  粉色の甜心
    2020-12-06 01:36

    It's because your csv has spaces before the quotes:

    one0, one1, one2
    two0, two1, two2
    tre0, "tr,e1", tre2
    

    vs

    one0,one1,one2
    two0,two1,two2
    tre0,"tr,e1",tre2
    

    You'll need to remove those extra spaces first.

提交回复
热议问题