Mac Format

Importing JSON to Excel

- by rich daniels

Q

What’s the best way to convert data I’ve obtained from websites in JSON format, into a format that I can import into Microsoft Excel?

A

JavaScript Object Notation (JSON) is an increasing­ly popular format for data obtained by querying online sources such as Twitter. As its name suggests, it’s primarily intended for use with JavaScript, and there are many free online services which will convert small amounts for you with ease.

Spreadshee­ts such as Excel and Numbers are traditiona­l in the formats they import, working best with plain text separated by tabs or commas (CSV). Transformi­ng JSON’s paired attributes and values into lines of tab- or comma-delimited text isn’t easy. The free statistica­l language R has a jsonlite package to import from JSON data, and an xlsx package to export to native Excel format. Even that isn’t simple though, as it tends to flatten the data into just two rows of the spreadshee­t. If possible, look to using JavaScript to write CSV text direct, or obtain the data in a different format which you could readily convert into tab- or comma-delimited lines of text.

There are also two free JSON databases, Apache CouchDB and MongoDB, which may provide suitable intermedia­tes to help store and convert data, and the format home page at json.org has a huge list of other support packages too. JSON editors like JSON Wizard reveal the structure of JSON data in the form of paired attributes and values, in a list.

Newspapers in English

Newspapers from Australia