What is the easiest way to convert an Excel spreadsheet with tabular data to JSON? [closed]
I want to convert spreadsheet data from Excel or Open Office saved as *.xls to *.json
- Data is not sensitive
- File is not very large
Assuming you really mean easiest and are not necessarily looking for a way to do this programmatically, you can do this:
-
Add, if not already there, a row of "column Musicians" to the spreadsheet. That is, if you have data in columns such as:
Rory Gallagher Guitar Gerry McAvoy Bass Rod de'Ath Drums Lou Martin Keyboards Donkey Kong Sioux Self-Appointed Semi-official Stomper
Note: you might want to add "Musician" and "Instrument" in row 0 (you might have to insert a row there)
-
Save the file as a CSV file.
-
Copy the contents of the CSV file to the clipboard
-
Go to http://www.convertcsv.com/csv-to-json.htm
-
Verify that the "First row is column names" checkbox is checked
-
Paste the CSV data into the content area
-
Mash the "Convert CSV to JSON" button
With the data shown above, you will now have:
[ { "MUSICIAN":"Rory Gallagher", "INSTRUMENT":"Guitar" }, { "MUSICIAN":"Gerry McAvoy", "INSTRUMENT":"Bass" }, { "MUSICIAN":"Rod D'Ath", "INSTRUMENT":"Drums" }, { "MUSICIAN":"Lou Martin", "INSTRUMENT":"Keyboards" } { "MUSICIAN":"Donkey Kong Sioux", "INSTRUMENT":"Self-Appointed Semi-Official Stomper" } ]
With this simple/minimalistic data, it's probably not required, but with large sets of data, it can save you time and headache in the proverbial long run by checking this data for aberrations and abnormalcy.
-
Go here: http://jsonlint.com/
-
Paste the JSON into the content area
-
Pres the "Validate" button.
If the JSON is good, you will see a "Valid JSON" remark in the Results section below; if not, it will tell you where the problem[s] lie so that you can fix it/them.