You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have const xlsx = require('xlsx'); in my script and then passing xlsx the URL data using:
constfr=newFileReader();fr.readAsDataURL(event.target.files[0]);fr.addEventListener('load',()=>{this.file.url=fr.result;// 'data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,UEsDBBQABgAIAAAAIQDv...});...handleForm(event){constworkbook=xlsx.read(this.file.url);constsheetNameList=workbook.SheetNames;sheetNameList.forEach(function(y){constworksheet=workbook.Sheets[y];constheaders={};constdata=[];for(constzinworksheet){if(z[0]==='!')continue;// parse out the column, row, and valuelettt=0;for(leti=0;i<z.length;i++){if(!isNaN(z[i])){tt=i;break;}};constcol=z.substring(0,tt);constrow=parseInt(z.substring(tt));constvalue=worksheet[z].v;// store header namesif(row===1&&value){headers[col]=value;continue;}if(!data[row])data[row]={};data[row][headers[col]]=value;}// drop those first two rows which are emptydata.shift();data.shift();console.log(data);});}
It is returning an Array of Objects, but the contents is gobbledygook! 😬
Hi there
I'm using Nuxt.js.
I have
const xlsx = require('xlsx');
in my script and then passing xlsx the URL data using:It is returning an Array of Objects, but the contents is gobbledygook! 😬
Example:
data[0]
returns...Example.xlsx
The text was updated successfully, but these errors were encountered: