adediran oladapo
adediran oladapo

Reputation: 89

Node.js convert excel to JSON

var question = [{
    "keys": 1,
    "titles": "Malawi is a country in which continent?",
    "method":"single",
    "answer":"Africa",
    "options":[{
        option1:"Africa",
        option2:"Asia",
        option3:"Europe",
        option4:"Australia"
    }]
}];

So questions would be an array of JSON structure of questions.

The image is a sample of the actual excel file and I have to make it look like the above JSON above. excel sample for view

Upvotes: 1

Views: 6344

Answers (1)

galactocalypse
galactocalypse

Reputation: 1935

You can use SheetJS's js-xlsx or xlsjs (doesn't support xlsx).

They're pretty easy to use and support multi-sheet workbooks as well.

Update

For comma or tab delimited data, you could try the parser from this repo.

Upvotes: 1

Related Questions