4

Is there a way to export a Numbers.app spreadsheet as a JSON formatted file? I know I can do it manually but this will be used as data input to an iOS app and I'd like to have an automated way to do this to reduce errors.

Here's an image of the rough spreadsheet:

enter image description here

2
  • 1
    Do you want to export the data in the cells or the formulas in the cells? A spreadsheet can be represented as a two-dimensional array of data, do you want rows inside of columns or columns inside of rows in the JSON document? What if there is non-spreadsheet data like a picture or a graph? What do you want to happen with multiple sheets? Just export current sheet? Export all sheets? This can be done with AppleScript, but as you can see there are lots of open questions...
    – Ian C.
    Jul 27, 2014 at 21:03
  • Ah, I should have said. No formulas, just text fields.its a two-dimensionalset. Each row is a record. A record has 7 or 8 elements, represented stored in columns. I will update the question with a view of the data set.
    – ICL1901
    Jul 28, 2014 at 1:32

2 Answers 2

1

I don't believe that you can directly convert a Numbers document to JSON. However, you can export a Numbers document to any number of formats, shown below.

Exporting a document

There are a bunch of converters for CSV->JSON. I found two online converters from a quick Google search: Convert CSV and Mr. Data Converter.

This is not an ideal solution if you have a lot of these documents to convert, but I am sure that it will be easier to find effective CSV->JSON converters than Numbers->JSON converters.

4
  • thanks. that works for testing.. Do you know if you can run javascript? or applescripts in Numbers?
    – ICL1901
    Jul 28, 2014 at 20:49
  • 1
    You can use AppleScript in conjunction with Numbers. macosxautomation.com/applescript/iwork/numbers
    – aglasser
    Jul 28, 2014 at 21:08
  • Hmm. maybe I can write an applescript to function as an exporter.. I have a javascript.. Thanks for the help.
    – ICL1901
    Jul 29, 2014 at 7:05
  • That will not work if one of the columns have paragraphs containg \n that is also used to separate lines on the CSV.
    – Duck
    Sep 1, 2022 at 13:10
0

I will hold out for a Numbers solution, but meanwhile, I have managed the process by using Google Sheets with this Javascript

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .