Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Convert text document to mysql

Text rows into mysql database?

12:35 pm on Jun 1, 2006 (gmt 0)

New User

10+ Year Member

joined:Mar 9, 2006
votes: 0


I have three million rows in a 150MB text document as so:

AD bixisarri Bixisarri 00 42.4833333 1.4666667
AD canillo Canillo 02 42.5666667 1.6

Respectively: country, city, city, numbers, latitude, longitude

Is it possible to convert that into a mysql dump document, using PHP for example?


3:08 pm on June 1, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 30, 2003
votes: 0

Hi alste123,

A couple of things you can look at:

PHP has a function called fgetcsv for importing CSV files, so you may be able to use that:


Alternatively, look into the MySQL LOAD_DATA function: