MySQL Forums
Forum List  »  Other Migration

Importing txt files into MySQL database
Posted by: Kim Jensen
Date: February 04, 2007 06:31AM

For a long time I've been considering converting all the information on my homepage from php based to database based but I've always put it off because I have no idea how to go about doing this.

My main problem is that I have thousands of .txt files that have information like in this example that are imported into a webpage using php.

-----
homersimpson.txt

firstname=Homer
lastname=Simpson
maritalstatus=Married
relatives=Marge (wife), Bart (son), Lisa (daugter), Maggie (daughter)... etc
hometown=Springfield
-----

and so on. Sometimes the order in the files is different and "lastname=" comes before "firstname=" and so on which makes it practically impossible for me to turn the files into a tab or commaseparated files.

Now what I'm interested in knowing is whether or not there is a way for me to import such txt files into MySQL so that the first names, last names and so on go in the right tables? And if there is how is it done? Is there a tuturial of some kind or something that might help me?

Thanks in advance.

Options: ReplyQuote


Subject
Views
Written By
Posted
Importing txt files into MySQL database
10262
February 04, 2007 06:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.