Link to home
Start Free TrialLog in
Avatar of cebrooks03
cebrooks03

asked on

import multiple data files using mysql's LOAD DATA INFILE statement from the command line.

I am trying to import not just one but numerous flatfile csv files using LOAD DATA INFILE statement from the mysql command line.  Using the code ive posted below i can insert a single .csv file but I need to be able to insert all .csv files that are in the same directory.  

Ive tried using *, %, and .*\  as wildcard operators but none of them have worked.


mysql --user=username --password=mypassword LOAD DATA LOCAL INFILE 'c:\\\files\\\\\\date20080808.txt.csv' INTO TABLE mytable FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' (field1, field2, field3)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial