Skip to content
Advertisement

Extract values from complicated JSON based on a specific condition using Java or Python [closed]

I am totally new to JSON. I have a JSON file that contains the following format:

JavaScript

I need to extract the following:

JavaScript

Which means: For each A, extract the commands if the meaning of the command is "Read" then extract the general command "XYZ" and the command-number.

Advertisement

Answer

You can import json library and use json.loads() function through python :

JavaScript

P.S. : Be careful about the removing of whitespace character after Read value of meaning key.

Advertisement