How to extract and open Json file in folder.
Show older comments
Dear All,
I have Json file in folder as attached. But, I tried to extract and open, it failed.
Some can help me?
2 Comments
Epsilon
on 18 Sep 2024
Please refer to the answer: https://www.mathworks.com/matlabcentral/answers/326764-how-can-i-read-a-json-file
If you are still facing issues, feel free to reply.
Walter Roberson
on 18 Sep 2024
You have to start by doing
S = fileread(' DVK_Cu-64_0.1_adipose.json.zip');
T = jsondecode(S);
bytearray = matlab.net.base64decode(T.base64_zip_o__);
fid = fopen('test.zip', 'w');
fwrite(fid, bytearray);
fclose(fid)
This will give you a file test.zip that is in zip format.
Unfortunately it is corrupted zip format, and it is not clear how to get further than this.
Accepted Answer
More Answers (0)
Categories
Find more on JSON Format in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!