Hi, I have created a mysql databse and a table called pcinfo, now I have a big comma separated text file, is there any way that I can use this text file to insert data into pcinfo table.
thanks
Majid,
I would look here:
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#LOAD_DATA
Look at the syntax for LOAD DATA
Chris
In phpMyAdmin, there's a "Insert textfiles into table" feature. I just used it to import a CSV into the database. Works great.
Hi, my text file is COMMA SEPARATED FIELDS, but when I used : LOAD DATA INFILE "data.txt" INTO TABLE db2.my_table; it took it as \t separated fields
Could you please help. Thanks
Of course it did, you need to specify the field terminator. Look a little closer at the syntax.
You might need to add some more conditions depending upon your data.
LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table FIELDS TERMINATED BY ',';