Reputation: 1397
I have been trying to convert excel sheet data to json format and I have already various modules like "xls-to-json","xls-to-json-lc","node-excel-to-json", So far I have got empty response.
My sample code goes like this :
var node_xj = require("xls-to-json");
node_xj({
input: req.file.path, // input xls
output: "output.json", // output json
sheet: "a" // specific sheetname
}, function(err, result) {
if(err) {
console.error(err);
} else {
console.log("--------result----");
console.log(result);
}
});
My excel sheet contains very simple data :
What am i doing wrong in this , I am getting file and its valid path .
Upvotes: 1
Views: 1233
Reputation: 1397
got the solution , all the libraries consider first row as header , so it was not getting displayed , it got displayed when i added 2nd row and every module has got its own structure of output/ response. some modules consider excel headers in output and skip the first row and few include first row .
Upvotes: 1