1

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 :

enter image description here

What am i doing wrong in this , I am getting file and its valid path .

2
  • What is the result of result that you're printing to console? Commented Nov 26, 2017 at 14:21
  • getting blank , empty Commented Nov 26, 2017 at 14:22

1 Answer 1

1

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 .

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.