往返 INTO OUTFILE、Excel 编辑和 LOAD DATA INFILE,不会损坏
我一直在尝试使用 INTO OUTFILE 将 mysql 表导出到 CSV,以便在 Excel 中进行编辑,然后使用 LOAD DATA INFILE 插入回 mysql。
我可以正常导出,甚至可以重新插入未编辑的文件。但是,如果我在 Excel 中打开进行更改然后保存,事情就会变得很糟糕。当它询问我是否确定要以 CSV 格式导出时,我选择“是”,但即使我尝试在 Excel 中重新打开该文件,它也会出现无效格式。
我想知道正确的设置“字段转义、终止等”是什么?每个命令都会有一个,以确保与 Excel 的兼容性。
谢谢,
I have been trying to export a mysql table with INTO OUTFILE to CSV for editing in Excel and then inserting back into mysql using LOAD DATA INFILE.
I can export ok, and even reinsert the unedited file. However, if I open in Excel make changes and then save things get screwed up. I select "Yes" when it asks if I'm sure I want to export in CSV, but even if I try and reopen the file in Excel it comes up with invalid format.
I am wondering what the proper settings "FIELDS ESCAPED BY, TERMINATED, etc." would be for each command to ensure compatibility with Excel.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够执行以下操作:
您也可以执行以下操作:
您还可以使用“|”作为分隔符并按分隔符导入文件。
You should be able to do:
You can also do:
You can also use '|' as delimiter and import the file as delimited.