Data saved in excel or other spreadsheet formats can easily be feed into a MySQL table using the Load Data function. The first thing to do is save/export your data from your spreadsheet in a tab-delimited format. Here is an example: "John Doe" "1111 test St" "555-555-5555" "Jane Doe" "1111 test St" "555-555-5555" If you had a text file with each piece of data seperated by tabs, and a new row of information on each line, you can easily import this data into a MySQL table. Example Table: create table customers( ID int not null auto_increment primary key, Name char(100), Address char(100), Phone char(12) ); To get your text file data into the MySQL table about you would run this command in MySQL. mysql > Load Data local Infile '/customer.txt' into table db.customer fields terminated by 't' enclosed by '"' lines terminated by 'rn'; Note: rn mean new lines. r means carriage return. n means new line.
|