SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Load Data

  1. #1
    Free me php klassicd's Avatar
    Join Date
    Sep 2001
    Location
    San Diego
    Posts
    509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Load Data

    I have a text file with roughly 400k lines like these:

    "nopchanok_s@hotmail.com","nopchanok","suwanpimolkul","prachautit 4","bkk.thailand","HI","10140","662-8730199","53"
    "cpatsygo@aol.com","Patsy","Hardwick","3884 Vista Largo Drive","Las Vegas","NV","89121","(702) 897-0022","48"
    "RN551@msn.com","ROSE MARY","LAWHORN","2155 W.171 ST. ","HAZEL CREST","IL","60429","7083350777","45"

    I know mysql has a LOAD DATE function and im trying to get it to work with these text files. I simple want to load this data into a table with these columns:

    "email","first","last","street","city","state","zip","phone","age"

    But it errors or times out each time. Any help would be appreciated.

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know anything about LOAD DATA, but if you know any ASP/VB then this would be quite easy to achieve. You can use the file system object to open the file cycle through your text file line by line creating an INSERT SQL string on the fly and executing it for each line of the txt file. You'd have to leave it running for a while to do 400,000 records though!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •