|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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) Thanks! |
|
#2
|
|||
|
|||
|
Hi.
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>'; |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > mySQL tables from text files? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|