在c / p到sqlite编辑器之后,我正在Excel中准备我的SQL查询。我尝试了两个不同的编辑器,问题是相同的。例如在Excel中,这就是我的查询外观
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个查询,我无法手动删除。我该如何解决?非常感谢
答案 0 :(得分:1)
这可能不是最好的方法,但是您可以将其另存为Formatted Text (Space delimited)
,并在以后用于复制粘贴。
在Excel 2019中
Save As Type
下拉列表中选择Formatted Text (Space delimited)
打开并从此处复制粘贴
有关格式,请参见下面的屏幕截图
另一种解决方法是使用Notepad++。
"
并删除。;"
->按CTRL+H
->将;"
替换为;
。 请参阅下面的GIF