README
Description
This is a project NodeJS / ES6 based that loads a file in XLSX format and inserts his content into a MySQL database
How to use
- 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
Usage
XLSX file (called 'XLSX')
There are an example XLSX file in
./files/BD_SAMPLE.xlsx
Filename
Name of the XLSX file (case-incensitive)
Worksheet
Name of the XLSX worksheet where is data (case-incensitive)
Columns
Name of the columns that contain the data (case-incensitive) See data types
MySQL
There are an example MySQL script file in
./files/bd_sample.sql
Database
Should be equals that XLSX file name (case-incensitive)
Table
Should be equals that XLSX worksheet (case-incensitive)
Columns
Should exists and be equals that XLSX columns (case-incensitive)
MySQL user credentials
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
}
Data Type
XLSX
In XLSX file is enought with store your data with General format
MySQL
In MySQL you could stote your data in a varchar field
for all your data
Dependences
- 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
To-do
- 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
Licence
Apache 2.0