Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
reading excel file using node js

i am trying to read data from an excel file nd save it to a 2d array removing excess data but when i try to use the 2d arrays outside of the function it doesn't work

const xlsxFile = require('read-excel-file/node');
var x = 0

function excel() {
  xlsxFile('./weather-data.xlsx').then((weather) => {
    var weatherLen = weather.length
    while ( x < weatherLen) {
      if(weather[x][1] == null) {
        delete weather[x]
      }
      x++
    }
    console.log(weather)
    weather_data = weather
  })
}
    
excel()
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!