简体   繁体   中英

Import multiple (100+) Excel files into MySQL Table

I have 100+ XLSX files that I need to get into a MySQL Database. Each file is a bit different, so I've created a massive table that contains a field for each possible column header across all files. This way they can auto-map on import.

Using Navicat I can import the files one at a time, but I'm wondering if there is a way to import all of the files at one time?

I'm thinking 'no' but if your going to do this a lot I think there are ways to automate this.

Export your xls-files into csv-files instead. Write some script to transform them between csv-excel style to csv-mysql style.

Create tables for importing with the csv engine . Put your files inplace of the ones created by mysql and flush tables. Now your data is ready to be read inside mysql and copied over to more powerful tables engines.

Another way is to do a VBA-script that exports the data in a format recognized by load data infile and then load them using mysql.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM