Today, the development of a requirement, you need to import the data in Excel into MySQL, originally wanted to import Excel into CSV format automatically has a comma, so with a comma as a delimiter, and then copy the data to a text file using MySQL load is possible, who knows not what I think.
Here's a look at the data form of Excel, the fourth field has a comma, I'm going to go, how to do this:
200005 |
Gold War boots |
|
The boots of pure gold are expensive and can be used to improve other anti-armor experience |
6 |
1 |
3 |
0 |
200006 |
Golden Sword |
|
The sword made of pure gold is expensive and can be used to improve the experience of other weapons. |
5 |
2 |
3 |
0 |
1 |
3. Finally, many tests were adopted to solve this problem:
First copy the file directly into the TXT file, then use the command in MySQL
Load data local infile "/tmp/test.txt" into table test_goods fields TERMINATED by ' \ t ';
This article from "Yaoshenshen" blog, declined reprint!
Excel data import MySQL