elsenorjose
Technical User
I have several text files I need to import into my DB and I'm looking for a shortcut using the LOAD DATA INFILE statement. The files are named using a number sequence which identifies the day for which the file exists:
wms.20070403.2007040300.vod.csv
wms.20070402.2007040200.vod.csv
wms.20070404.2007040400.vod.csv
Etc...
I've written a batch script which I call from the command line to import the data but it's a real pain to have to change the file names every time I get a new set of files. I have 30 files to import so I don't really look forward to 'find/replace'ing 30 lines of code. Is there a way to load the data using wildcards? Since all of these files will get imported into the same table, I would like to just write something like:
LOAD DATA LOCAL INFILE 'c:/data/*.vod.txt' INTO TABLE vod_table;
I've tried that and I get an error saying that file doesn't exist.
I haven't found anything on the MySQL site or Googling so I'm hoping I can get some help here.
wms.20070403.2007040300.vod.csv
wms.20070402.2007040200.vod.csv
wms.20070404.2007040400.vod.csv
Etc...
I've written a batch script which I call from the command line to import the data but it's a real pain to have to change the file names every time I get a new set of files. I have 30 files to import so I don't really look forward to 'find/replace'ing 30 lines of code. Is there a way to load the data using wildcards? Since all of these files will get imported into the same table, I would like to just write something like:
LOAD DATA LOCAL INFILE 'c:/data/*.vod.txt' INTO TABLE vod_table;
I've tried that and I get an error saying that file doesn't exist.
I haven't found anything on the MySQL site or Googling so I'm hoping I can get some help here.