Rank: 1164 based on 60 downloads (last 30 days) and 1 file submitted
photo

François Glineur

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by François
Updated   File Tags Downloads
(last 30 days)
Comments Rating
11 Jan 2011 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur json, cells, javascript, parser, cell arrays, data import 60 17
  • 4.83333
4.8 | 6 ratings
Comments and Ratings by François View all
Updated File Comments Rating
11 Jan 2011 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur

Dear Benjamin: you are right, the function returns a cell array only if the topmost entity in the JSON string is an array ; if it is instead an object, the function returns a structure. I have updated the description to reflect that.

21 Jul 2009 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur

Rob, the problem is caused by field "526A", which MATLAB cannot accept because field names in MATLAB must start with a letter. I will update the parser to convert invalid field names into acceptable ones.

21 Jul 2009 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur

Rob, have you checked that the argument you pass to parse_json is a string ? The easiest way to convert the contents of a file into a string is to use the function fileread, as in this example :

s = fileread('file.json');
res = parse_json(s);

23 Mar 2009 JSON Parser Parses JSON strings into structures and cells Author: Joel Feenstra

An alternative parser with faster handling of strings is available at http://www.mathworks.com/matlabcentral/fileexchange/23393
(another JSON Parser). For example, running the example above

companies=parse_json(urlread('http://api.crunchbase.com/v/1/companies.js'));

with it now takes less than 30 seconds.

Comments and Ratings on François' Files View all
Updated File Comment by Comments Rating
15 Jan 2012 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur Fang, Qianqian

FYI, an optimized JSON parser, JSONlab, based on this work is available at

http://www.mathworks.com/matlabcentral/fileexchange/33381

It is 10x to 100x faster. A JSON encoder is also provided in JSONlab.

06 Jul 2011 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur Hokanson, Jim

I love the use of nested functions! Well written.

06 Jul 2011 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur Hokanson, Jim
25 Feb 2011 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur Eric

Works like a charm on WeatherBug REST JSON API output of hourly weather forecasts.

11 Jan 2011 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur Glineur, François

Dear Benjamin: you are right, the function returns a cell array only if the topmost entity in the JSON string is an array ; if it is instead an object, the function returns a structure. I have updated the description to reflect that.

Top Tags Applied by François
cell arrays, cells, data import, javascript, json
Files Tagged by François
Updated   File Tags Downloads
(last 30 days)
Comments Rating
11 Jan 2011 (another) JSON Parser Parses JSON strings into structures and cell arrays. Author: François Glineur json, cells, javascript, parser, cell arrays, data import 60 17
  • 4.83333
4.8 | 6 ratings

Contact us at files@mathworks.com