MySQL Forums
Forum List  »  Perl

Re: Using load data for multiple files
Posted by: David West
Date: February 25, 2010 05:05PM

Are you trying to load 516 files (i.e., seperate csv files) or 516 rows of data (ie.., records)? If you are loading csv files, you may want to make sure the files are saved as csv (ie., filename.csv). Otherwise, you should be able to load all the files using Load Data Infile. See sample below. If you are using csv with headers you will ignore the headers (i.e., ignore 1 lines).

You could run as a script from the mySQL Qwery Browser, which will load multiple files in one run - you will need multiple load data scripts. You could also design a stored procedure if this is routine. I have not used the Data Migration tools yet, which is another option.

Load Data Infile 'SupplierTimesheetReport.csv'
Into Table WorkerHours
Fields Terminated by ','
Optionally Enclosed by '"'
Lines Terminated by '\r\n'
Ignore 1 Lines;

Options: ReplyQuote


Subject
Written By
Posted
Re: Using load data for multiple files
February 25, 2010 05:05PM


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.