I`m trying to set a result query into an array or JSON object using ALASQL:
var resdata2 = [ { A: "test", B: "testB" } ]; // Destination array
// Select first and second column values from xlxs
alasql('select A,B into ? from xlsx("gohan.xlsx")', [resdata2]);
console.log(resdata2); // Shows one object for xlsx line!
console.log(resdata2.length); // Shows length of 1 only
$.each(resdata2,function(idx, obj) {
console.log(obj.A); // Shows only 'test'
console.log(obj.B); // Shows only 'testB'
});
The spreadsheet has 18 lines which appear in the first console.log(), however in second console.log() and in each function, it shows only first line "Test" and "testB".
Any ideas to show all lines?
var result = alasql('SELECT A,B FROM xlsx("gohan.xlsx")');