开发者

Importing excel data in to mysql table using command line

I have lot of excel files to import in mysql table.

Is there any mysql c开发者_JAVA百科ommand/procedure which directly takes excel file and import it in table one by one?

or any simpler way to to this task in few steps?


MySQL can't read Excel files directly.

Either convert the Excel files to CSV, or write a script that reads the Excel files (using the appropriate excel-reader libraries for your language of choice) and inserts that data into MySQL.

There are a few programs available that will allow you to batch convert files from Excel to CSV (e.g this one from SoftInterface, which was the first result returned by a Google search on "Excel to CSV")


If you're doing this all a Windows box, you could set up the Excel files as ODBC databases and use Access or similar to copy all the data over to MySQL via its own ODBC connector, but then you're stuck having to set up a DSN for each excel file, or manually cutting/pasting the data into a single ODBC's .xls from each other .xls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜