Last active
January 5, 2022 21:18
-
-
Save HussainArif12/64da8cba6953ceb2772af5d9608cdc32 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xlsx = require("xlsx"); | |
const path = require("path"); | |
const fileLocation = path.join(__dirname, "Expenses.xlsx"); | |
const fileContents = xlsx.readFile(fileLocation); | |
const firstSheet = fileContents.SheetNames[0]; | |
const sheetValues = fileContents.Sheets[firstSheet]; | |
const parsedJSON = xlsx.utils.sheet_to_json(sheetValues); | |
function getParsedJSON() { | |
return parsedJSON; | |
} | |
console.log(getParsedJSON()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment