Bug 103498 - Save Tabular Data to JSON
Summary: Save Tabular Data to JSON
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Format-Filters
  Show dependency treegraph
 
Reported: 2016-10-25 14:31 UTC by launchpad
Modified: 2023-04-17 05:35 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description launchpad 2016-10-25 14:31:27 UTC
Because I often find myself saving tabular data to a csv file, and then converting that csv file to JSON, I'm proposing the enhancement of enabling Libre Calc to directly save tabular data to JSON.
Comment 1 launchpad 2016-10-25 15:28:28 UTC
I don't think it will be hard to find open source code that already does this. Mainly, the effort would be a matter of incorporating that code into the Libre Calc project.

For example, I'm currently using this to do it:
https://www.npmjs.com/package/csvtojson
Comment 2 Urmas 2016-10-25 23:28:16 UTC
Is there a single way to represent spreadsheets in JSON?
Comment 3 Heiko Tietze 2016-10-27 08:10:49 UTC
How about an extension?

Was looking for a solution and found very quickly http://www.csvjson.com/csv2json. The request needs to define precisely constraints and needed options. But I guess it's a good enhancement either per extension or inbuilt -> NEW.
Comment 4 launchpad 2020-07-15 08:56:08 UTC
There are multiple ways to represent a spreadsheet using JSON, but the most expected way would probably be an array of objects where each row is an object and each column-name becomes a property of each of those objects. Yeah, that's verbose, but it is probably what most people would expect from a "Save as JSON" option.

For this request, I was not thinking about super complicated spreadsheets. I was mainly thinking about simple tables that you can currently save to a csv. Any spreadsheet that can be saved as csv can certainly also be converted to JSON almost as easily.

One nice thing about JSON is that it already handles edge cases that might corrupt a CSV file (a cell with its on internal commas for example is problematic with CSV).

Does Excel offer this feature? If so, I say just do it a little better than how they do it.