title: How to loop through a json array and find a match for each item in bigger json fille?
body: <p>For example, I have this json file:</p>
  <pre><code>[
    {
      &quot;Name&quot;: &quot;Bob&quot;,
      &quot;Grade&quot;: &quot;Pass&quot;
    },
    { 
      &quot;Name&quot;: &quot;Alice&quot;,
      &quot;Grade&quot;: &quot;Fail&quot;
    },
    {
      &quot;Name&quot;: &quot;Mallory&quot;,
      &quot;Grade&quot;: &quot;Fail&quot;
    }
  ]
  </code></pre>
  <p>And this array <code>[&quot;Bo&quot;, &quot;Al&quot;]</code></p>
  <p>How do I loop through the array to check the json file for those students only and output their {Name, Grade}?</p>
  <p>Also a note, I can do a series of pipes of <code>select(test(.Name == &quot;Bob&quot;))</code> but I can't hardcode it as the array is being generated dynamically depending on a selection.</p>
  <p>Let me know if you need further clearance.</p>
  <p>Thank you!</p>
  <p>Note: Edited to ask how to do this for substrings, like &quot;Bo&quot; and &quot;Al&quot; for &quot;Bob&quot; and &quot;Alice&quot;. Apologies as I'm really quite new to jq advanced topics. Thank you again!</p>