Reputation: 408
how can i insert values in a field of a table in MySQL, from a .txt file line for line ?
My .txt is like:
name1
name2
name3
name4
(line per line)
i read a lot on Stackoverflow, i found this: insert in mysql table from .txt file
but my situation is little different, i'm triyng to modify the linked post's query, but unsuccesful :-( thanks !!
Upvotes: 0
Views: 157
Reputation: 13496
LOAD DATA INFILE 'testfile.txt'
INTO TABLE testtable
FIELDS TERMINATED BY '\r' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
(name);
Upvotes: 1