简体   繁体   中英

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.

Now when I am importing this file in database i get following result.

数据库数据

Text written in excel file is

Hi this is test – “%%title%%”

Hi this is eg – “%%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.

I would add regular expression handling to your 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM