T0PS3O
May 10th 2005, 2:49 pm
I want to load a tab delimited file into my MySQL database via PHPMyAdmin. I'm trying to use the "Insert data from a textfile into table" function but it won't work. It stops after one row which goes completely wrong.
Sample from my .txt file (hope it parses alright here):
0S 0s 1 0
100000S 100000s 1 100000
1000S 1000s 1 1000
100S 100s 1 100
10S 10s 1 10
11S 11s 1 11
Location of the textfile = obvious
Replace table data with file = obvious
Fields terminated by = 'nothing' I guess
Fields enclosed by = 'nothing' I guess
Fields escaped by = not applicaple
Lines terminated by = \r\n I guess
Column names = n/a leaving it blank
LOAD method = DATA LOCAL
With the options I've tried it either loads each line into one field terminating after 4 fields which is one row. Or it puts the entire line into the first field and terminates after one row.
I don't know what to put in Field Terminated By since it's a tab and I don't know how to specify that.
Help appreciated.
Sample from my .txt file (hope it parses alright here):
0S 0s 1 0
100000S 100000s 1 100000
1000S 1000s 1 1000
100S 100s 1 100
10S 10s 1 10
11S 11s 1 11
Location of the textfile = obvious
Replace table data with file = obvious
Fields terminated by = 'nothing' I guess
Fields enclosed by = 'nothing' I guess
Fields escaped by = not applicaple
Lines terminated by = \r\n I guess
Column names = n/a leaving it blank
LOAD method = DATA LOCAL
With the options I've tried it either loads each line into one field terminating after 4 fields which is one row. Or it puts the entire line into the first field and terminates after one row.
I don't know what to put in Field Terminated By since it's a tab and I don't know how to specify that.
Help appreciated.