JSONLab now supports JSON Path syntax for slicing complex struct parsed from NeuroJSON.io data #10
fangq
started this conversation in
NeuroJSON JSON format specifications and parsers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have refined the early implementation of JSON Path support, and now it can handle scan operator
..and one can perform flexible search of values inside a hierarchicalstruct/cell/containers.Mapobject (such as those parsed from NeuroJSON.io datasets).For example, for a struct
{ "book": [ { "author": "Nigel Rees", "price": 8.95 }, { "author": "Evelyn Waugh", "price": 12.99 } ], "bicycle": { "color": "red", "price": 19.95 } }we can list all
pricesubfield usejsonpath(data, '$..price'), list allbook.authorsubfields asjsonpath(data, '$.book..author'); or the full information for the 1st book asjsonpath(data, '$.book[0]').Because JSONLab is portable, this feature is supported in both MATLAB and Octave.
here are some examples
for MATLAB
for Octave
Beta Was this translation helpful? Give feedback.
All reactions