我在sqlite中出现双引号错误

时间:2020-05-23 22:07:47

标签: sql excel sqlite android-sqlite

在c / p到sqlite编辑器之后,我正在Excel中准备我的SQL查询。我尝试了两个不同的编辑器,问题是相同的。例如在Excel中,这就是我的查询外观

enter image description here

enter image description here

INSERT INTO jokes_table (id, title, joke, cat, fav, bookmark)
VALUES ("9", "There''s this dyslexic guy... he walked into a bra...", "There''s this dyslexic guy... he walked into a bra...", "Bar", "0", "0");

在sqlite编辑器中变为

"INSERT INTO jokes_table (id, title, joke, cat, fav, bookmark) VALUES (""1"", ""What do you call a cow with no legs?

Ground Beef!"", ""What do you call a cow with no legs?

Ground Beef!"", ""Animal"", ""0"", ""0"");"

查询的开头和结尾都有多余的引号。我知道发生这种情况的原因是“底线”,但是如果我手动删除多余的引号,则编辑器即使没有底线也可以运行代码而不会出现任何错误。有10.000个查询,我无法手动删除。我该如何解决?非常感谢

1 个答案:

答案 0 :(得分:1)

这可能不是最好的方法,但是您可以将其另存为Formatted Text (Space delimited),并在以后用于复制粘贴。

在Excel 2019中

  1. 另存为>更多选项>
  2. Save As Type下拉列表中选择Formatted Text (Space delimited)
  3. 将文件重命名为文件名。 txt (。txt,而不是prn)

打开并从此处复制粘贴

有关格式,请参见下面的屏幕截图

enter image description here


另一种解决方法是使用Notepad++

  1. 在记事本中打开csv ++
  2. 按Alt键,然后在查询的开头选择所有"并删除。
  3. 选择;"->按CTRL+H->将;"替换为;
  4. 完成

请参阅下面的GIF

enter image description here

相关问题