text: user16470: I have a long list of JSON data, with repeats of contents similar to followings.
  Due to the original JSON file is too long, I will just shared the hyperlinks here. This is a result generated from a database called RegulomeDB.
  Direct link to the JSON file
  I would like to extract specific data (eQTLs) from "method": "eQTLs" and "value": "xxxx", and put them into 2 columns (tab delimited) exactly like below.
  Note: "value":"xxxx" is extracted right after "method": "eQTLs"is detected.
  eQTLs   firstResult, secondResult, thirdResult, ...
  
  In this example, the desired output is:
  eQTLs   EIF3S8, EIF3CL
  
  I've tried using a python script but was unsuccessful.
  import json
  with open('file.json') as f:
      f_json = json.load(f)
      print 'f_json[0]['"method": "eQTLs"'] + "\t" + f_json[0]["value"]
  
  Thank you for your kind help.
  
  user16471: Here a jq solution if you can use it:
  jq -r --arg f "eQTLs" '$f + "\t" + ([."@graph"[] | select(.method == $f) | .value] | join(", "))' file.json
  
  Explanations:
  
  -r: Raw string result (so result string will be without between ")
  --arg name value: Your filter on eQTLs method value
  Search in @graph array elements with []
  Select only array element with method attribute equals to eQTLs (in $f argument)
  The result, 2 in this case, are put in a array [...] and join with string , 
  $f string, a tabulation "\t" and the join result are concatenated to one string with + operators
  
  Result:
  eQTLs   EIF3S8, EIF3CL
  
  
original_text: 16470: <p>I have a long list of JSON data, with repeats of contents similar to followings.</p>
  <p>Due to the original JSON file is too long, I will just shared the hyperlinks here. This is a result generated from a database called RegulomeDB.</p>
  <p><a href="https://regulomedb.org/regulome-search/?regions=chr16:28539847-28539848&amp;genome=GRCh37&amp;format=json" rel="nofollow noreferrer">Direct link to the JSON file</a></p>
  <p>I would like to extract specific data (eQTLs) from <code>&quot;method&quot;: &quot;eQTLs&quot;</code> and <code>&quot;value&quot;: &quot;xxxx&quot;</code>, and put them into 2 columns (tab delimited) exactly like below.
  Note: <code>&quot;value&quot;:&quot;xxxx&quot;</code> is extracted right after <code>&quot;method&quot;: &quot;eQTLs&quot;</code>is detected.</p>
  <pre><code>eQTLs   firstResult, secondResult, thirdResult, ...
  </code></pre>
  <p>In this example, the desired output is:</p>
  <pre><code>eQTLs   EIF3S8, EIF3CL
  </code></pre>
  <p>I've tried using a python script but was unsuccessful.</p>
  <pre><code>import json
  with open('file.json') as f:
      f_json = json.load(f)
      print 'f_json[0]['&quot;method&quot;: &quot;eQTLs&quot;'] + &quot;\t&quot; + f_json[0][&quot;value&quot;]
  </code></pre>
  <p>Thank you for your kind help.</p>
   16471: <p>Here a <code>jq</code> solution if you can use it:</p>
  <pre class="lang-bash prettyprint-override"><code>jq -r --arg f &quot;eQTLs&quot; '$f + &quot;\t&quot; + ([.&quot;@graph&quot;[] | select(.method == $f) | .value] | join(&quot;, &quot;))' file.json
  </code></pre>
  <p>Explanations:</p>
  <ul>
  <li><code>-r</code>: Raw string result (so result string will be without between <code>&quot;</code>)</li>
  <li><code>--arg name value</code>: Your filter on <code>eQTLs</code> method value</li>
  <li>Search in <code>@graph</code> array elements with <code>[]</code></li>
  <li>Select only array element with <code>method</code> attribute equals to <code>eQTLs</code> (in <code>$f</code> argument)</li>
  <li>The result, 2 in this case, are put in a array <code>[...]</code> and join with string <code>, </code></li>
  <li><code>$f</code> string, a tabulation <code>&quot;\t&quot;</code> and the join result are concatenated to one string with <code>+</code> operators</li>
  </ul>
  <p>Result:</p>
  <pre><code>eQTLs   EIF3S8, EIF3CL
  </code></pre>
  