today is the national Mathematical Modeling competition, students choose a topic need to a large Excel table statistics, Good friend ~ ~ helped him to complete the conversion of data from Excel to MySQL. Write down the specific steps to share to everyone, also lest everyone to the Internet everywhere search. If you want to import the Excel table into the MySQL database, , Step one: Select the data you want to import quickly, and another column, such as: Step two: Copy the selected data to a new table workbook, and then save as-text file (tab split) (*.txt), if it is in the "D:\data.txt" position. Step three: Build the MySQL database and table based on the data you want to import, and then use the command Load data local infile ' D:\data.txt ' into Table Exceltomysql fields terminated by ' \ t '; The carries out the import operation. For example: Now the data has all been imported into MySQL, Let's select a bit, Here, the data from Excel to MySQL conversion has been completed. Next, the data from MySQL to Excel conversion, the process is actually the use of the "tab split" text file. will be able to import the male information from this table into Excel. Select * into outfile ' D:\man.txt ' from exceltomysql where xingbie= "male"; This way, the information for all the boys in the table is exported to a text file in the D:\man.txt file that ends with a tab segment, ' \ n '. You can open Excel and choose Import data, import external data, and select D:\man.txt to make sure it's all right. |