简体   繁体   English

将CSV文件导入sqlite表

[英]importing CSV file into sqlite table

I've imported a CSV file into an sqlite table. 我已经将CSV文件导入了sqlite表。 everything went fine except it included quotes " " around the data in the fields. 一切都进行得很好,除了它在字段中的数据周围加上了引号“”。 not sure why because there are no quotes in the CSV file. 不知道为什么,因为CSV文件中没有引号。

anyone know how to avoid this or get rid of the quotes somehow? 有谁知道如何避免这种情况或以某种方式摆脱报价?

Here's a screenshot from the firefox sqlite import settings I'm using: 这是我使用的firefox sqlite导入设置的屏幕截图:

替代文字

thanks for any help. 谢谢你的帮助。

I would guess that there really ARE double-quotes around the data. 我猜想数据中确实有双引号。 If you use Windows, a CSV will automatically open in Excel and it looks like there are no quotes because Excel interprets the file properly. 如果您使用Windows,则CSV会自动在Excel中打开,并且由于Excel正确地解释了文件,因此好像没有引号。 However, I bet if you open the file in Notepad there will be quotes around the strings. 但是,我敢打赌,如果您在记事本中打开文件,则字符串周围会出现引号。

and then, as pointed out in your discussion above, truncate your sqlite table and reimport the data, indicating that the fields are enclosed by double quotes. 然后,如上面的讨论所指出的,截断sqlite表并重新导入数据,指示字段用双引号引起来。

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

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