从加载到数据库的 CSV 数据中快速删除单引号
我有一个由从外部源加载的 CSV 文件构建的数据库。由于某种原因,许多表中的 ID 号被加载到用单引号括起来的 CSV/数据库中 - 这是一个示例行:
"'010010'","MARSHALL MEDICAL CENTER NORTH","8000 ALABAMA HIGHWAY 69","","","GUNTERSVILLE","AL","35976","MARSHALL","2565718000","Acute Care Hospitals","Government - Hospital District or Authority","Yes"
是否有任何 SQL 我可以在已经建立的数据库上运行来删除这些单引号,或者执行以下操作:我必须解析每个 CSV 文件并重新导入吗?
I have a database built from CSV files loaded from an external source. For some reason, an ID number in many of the tables is loaded into the CSV / database encased in single quotes - here's a sample line:
"'010010'","MARSHALL MEDICAL CENTER NORTH","8000 ALABAMA HIGHWAY 69","","","GUNTERSVILLE","AL","35976","MARSHALL","2565718000","Acute Care Hospitals","Government - Hospital District or Authority","Yes"
Is there any SQL I can run on the already-established database to strip these single quotes, or do I have to parse every CSV file and re-import?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信以下方法可以做到这一点(首先测试它):
如果它工作正常,请在生产中运行之前进行完整备份。
I believe the following would do it (test it first):
If it works right, do a full backup before running it in production.