Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 621
B. Clay Shannon-B. Crow Raven Avatar asked Oct 04 '13 17:10

B. Clay Shannon-B. Crow Raven


People also ask

How do I convert an Excel file to JSON?

There is no predefined method in Excel to convert the Excel data to JSON. You can either use online Excel to JSON conversion software or download an add-in from the Microsoft store for this task to get done.

Can you export JSON from Excel?

JSON (Javascript Object Notation) is the most used data exchange format nowadays. Microsoft Excel doesn't have built-in support for importing JSON to excel or exporting excel data to JSON.


1 Answers

Assuming you really mean easiest and are not necessarily looking for a way to do this programmatically, you can do this:

  1. 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)

  2. Save the file as a CSV file.

  3. Copy the contents of the CSV file to the clipboard

  4. Go to http://www.convertcsv.com/csv-to-json.htm

  5. Verify that the "First row is column names" checkbox is checked

  6. Paste the CSV data into the content area

  7. 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.

  8. Go here: http://jsonlint.com/

  9. Paste the JSON into the content area

  10. 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.

like image 195
B. Clay Shannon-B. Crow Raven Avatar answered Sep 19 '22 06:09

B. Clay Shannon-B. Crow Raven