[英]How to take special characters in database while importing from .csv file?
I had created one excel with following data 我用以下数据创建了一个Excel
and saved it as .csv(comma delimited format)in excel. 并在excel中将其另存为.csv(逗号分隔格式)。
Now when I am importing this file in database i get following result. 现在,当我将此文件导入数据库时,得到以下结果。
Text written in excel file is 用excel文件写的文字是
Hi this is test – “%%title%%”
嗨,这是测试-“ %% title %%”
Hi this is eg – “%%title%%”
嗨,这是–例如“ %% title %%”
Any way to add similar text in database by importing file? 有什么方法可以通过导入文件在数据库中添加类似的文本?
I can manually add this in database and it accepts too but I have large no of data to be imported. 我可以在数据库中手动添加它,它也可以接受,但是我没有大量要导入的数据。
I had changed collation to latin1_bin but it didn't worked. 我已经将排序规则更改为latin1_bin,但是没有用。
I would add regular expression handling to your excel. 我会向您的excel添加正则表达式处理。
File-> Options-> Customize Ribbon -> Check "Developer" checkbox on right. 文件->选项->自定义功能区->选中右侧的“开发人员”复选框。
Now follow this guide to create a function to find special characters prior to import. 现在,按照本指南创建在导入之前查找特殊字符的函数。
You can then run a Find/Replace on each problem character that is found, replacing the long dash with two single dashes (or just one). 然后,您可以对找到的每个问题字符运行“查找/替换”,将长破折号替换为两个单破折号(或仅一个)。 You will also want to replace other things like the elipses character with "..." but you wont need to replace most of the common characters found on the keyboard like !@$%^ etc.
您还将需要用“ ...”替换其他内容,例如,省略号字符,但您将不需要替换键盘上的大多数常见字符,例如!@ $%^等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.