Hello everyone,
I have a bunch of .json files in a folder called "JSON files". Each file is an article. I would like to put the paper_id, title, abstract, and authors' affiliation in an excel files.
files = dir('JSON files/*.json');for i=1:numel(files) filename = fullfile(files(i).folder, files(i).name); data = jsondecode(fileread(filename));end
the "data" in the above code for each i looks like
data = struct with fields: paper_id: '0015023cc06b5362d332b3baf348d11567ca2fbb' metadata: [1×1 struct] abstract: [2×1 struct] body_text: [20×1 struct] bib_entries: [1×1 struct] ref_entries: [1×1 struct] back_matter: [1×1 struct]
and
data.metadata = struct with fields: title: 'The RNA pseudoknots in foot-and-mouth disease virus are dispensable for genome replication but essential for the production of infectious virus. 2 3' authors: [17×1 struct]
and
data. metadata.authorsans = 17×1 struct array with fields: first middle last suffix affiliation email
for this specific article the affiliation is empty. However most of the .json files have an authors' affiliation. Moreover, each author may have different affiliation from her co-authors. I would like to keep all afiliations.
Any idea how I can solve this problem? Any input would be greatly appreciated!
Best Answer