MySQL Forums
Forum List  »  MySQL Query Browser

can you import multiple CSV files with one LOAD DATA command?
Posted by: Stan Chernov
Date: June 28, 2010 11:12AM

hello, everyone... i am fairly new to MySQL and still in process of figuring out how to upload CSV files to my first MySQL db...

i've got my LOAD DATA to work with on CSV file, and now i am trying to figure out if i can upload more then one CSV file into same table (both CSV files are in same format) with my LOAD DATA command.

this is what i have so far:
LOAD DATA LOCAL INFILE 'C:/DataFile01.csv'
into table my_cool_table
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(field1,
field2,
field3,
field4)
set id=null;

any advice on how i could upload two files (DataFile01.csv and DataFile02.csv)? if it's pretty advanced i'd apreciate somebody just pointing me to a read me file or a tutorial of some sort...

EDIT: BTW, both CSV files have a header as 1st row, and both (headers aka 1st rows) should be excluded from actual data import.

thanks,

stan



Edited 1 time(s). Last edit at 06/28/2010 11:31AM by Stan Chernov.

Options: ReplyQuote


Subject
Written By
Posted
can you import multiple CSV files with one LOAD DATA command?
June 28, 2010 11:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.