how to import excel file (XLSX) to mysql using nodejs

17,560

A few methods which come to my mind:

  1. Save the excel sheet(s) you want to import in csv format, and then import them into mysql : cf. How to import CSV file to MySQL table By far the simplest method, but you might run into trouble with quotes and commas and other idiosyncrasies.

  2. use an javascript excel parser to read the excel file and perform directly with code the update in your mysql database : cf. https://github.com/SheetJS/js-xlsx That option is more complex but it allows you to automate the task should you have many files to copy.

Share:
17,560
Labeo
Author by

Labeo

Updated on June 27, 2022

Comments

  • Labeo
    Labeo almost 2 years

    I am trying to import data in excel file to mysql just like row colon using nodejs are there any references i can learn or any module in nodejs that does my work or any sample code

    I have searched in google but i have seen solutions for only mongodb and for python ,