1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    I am sure mySQL allows this method. Could you guide me how I can update/insert into a table mySQL using a text file. My text format is using "delimiter", just like it is used in .htpasswd file from Apache.

    My file is stored under my home directory (/home/www/test.dat)

  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)

    Check out the "LOAD DATA" command.

    You might use something like:

    load data infile '/home/www/test.dat' into table <mytable> fields terminated by '<delimiter>';
  4. #3
  5. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    I found something very similar to work, but had to include LOCAL in the SQL statement if the file was not directly on the MySQL server. My text file was tab delimited so I apparently did not need to specify the delimiter. SQL I used was like:

    LOAD DATA LOCAL INFILE '/home/www/textfile.txt' INTO TABLE tablename

Similar Threads

  1. Javascript scrollbar - stuck on last bit
    By NayMyoSan in forum JavaScript Development
    Replies: 0
    Last Post: January 3rd, 2004, 12:05 PM
  2. Problem with dynamic text fields
    By Wallabee in forum PHP Development
    Replies: 6
    Last Post: November 21st, 2003, 05:20 PM
  3. Replies: 5
    Last Post: October 2nd, 2003, 11:21 PM
  4. Replies: 0
    Last Post: September 1st, 2003, 01:36 AM
  5. text files to tables
    By lee_c in forum HTML Programming
    Replies: 0
    Last Post: August 2nd, 1999, 07:32 AM

IMN logo majestic logo threadwatch logo seochat tools logo