This is a project NodeJS / ES6 based that loads a file in XLSX format and inserts his content into a MySQL database
- Create XLSX file See how to create XLSX file
- Create MySQL database See how to create MySQL database
- Install with
npm i xlsx-load-node
or download the project inZIP file
- Start
NodeJS
in the project directory withnode main.js
- Go to http://localhost:911/cargar-xlsx-web
- Load
XLSX file
- See results
There are an example XLSX file in
./files/BD_SAMPLE.xlsx
Name of the XLSX file (case-incensitive)
Name of the XLSX worksheet where is data (case-incensitive)
Name of the columns that contain the data (case-incensitive) See data types
There are an example MySQL script file in
./files/bd_sample.sql
Should be equals that XLSX file name (case-incensitive)
Should be equals that XLSX worksheet (case-incensitive)
Should exists and be equals that XLSX columns (case-incensitive)
Adds your MySQL Server credentials in this file
constantes.js
exports.configuracionBD = {
HOST: "your_mysql_host",
BD_USER: "your_mysql_user",
BD_NAME: "your_mysql_db_name",
BD_PASSWORD: "your_mysql_pwd",
BD_PORT: your_mysql_port
}
In XLSX file is enought with store your data with General format
In MySQL you could stote your data in a varchar field
for all your data
- xlsx-mysql load lib
- MySQL
- NodeJS
- Express
- Boostrap 4
- FontAwesome 5.1.1
The project is 100% free to use for non-commercial purposes, If you use this project please give the respective credits to the author
- Help me to develop more projects like this https://www.buymeacoffee.com/alonsokyoyama
- Catch XLSX library errors and display them in the view
- Improvements in Ajax calls on client-side
- Show load statistics to the database when file is succesfully loaded
Apache 2.0