title: Can I use jq for using parameters from a JSON file to filter and modify another JSON file?
body: <p>Let's say I have two input JSON files. The first one is:</p>
  <pre><code>[
      {
          &quot;name&quot;: &quot;one&quot;,
          &quot;keyB&quot;: &quot;2&quot;,
          &quot;keyC&quot;: &quot;3&quot;
      },
      {
          &quot;name&quot;: &quot;two&quot;,
          &quot;keyB&quot;: &quot;15&quot;,
          &quot;keyC&quot;: &quot;20&quot;
      }
  ]
  </code></pre>
  <p>And the second one:</p>
  <pre><code>{
      &quot;name&quot;: &quot;one&quot;,
      &quot;type&quot;: &quot;FeatureCollection&quot;,
      &quot;features&quot;: [
          {
              &quot;name&quot;: &quot;one&quot;,
              &quot;valueA&quot;: &quot;0&quot;,
              &quot;valueB&quot; : &quot;0&quot;
          },  
          {
              &quot;name&quot;: &quot;two&quot;,
              &quot;valueA&quot;: &quot;11&quot;,
              &quot;valueB&quot;: &quot;21&quot;
          },
          {
              &quot;name&quot;: &quot;one&quot;,
              &quot;valueA&quot;: &quot;21&quot;,
              &quot;valueB&quot;: &quot;30&quot;
          },  
          {
              &quot;name&quot;: &quot;two&quot;,
              &quot;valueA&quot;: &quot;1&quot;,
              &quot;valueB&quot;: &quot;2&quot;
          },
          {
              &quot;name&quot;: &quot;one&quot;,
              &quot;valueA&quot;: &quot;2&quot;,
              &quot;valueB&quot;: &quot;3&quot;
          },  
          {
              &quot;name&quot;: &quot;two&quot;,
              &quot;valueA&quot;: &quot;5&quot;,
              &quot;valueB&quot;: &quot;3&quot;
          }
      ]
  }
  </code></pre>
  <p>I'd like to create a logic that when <code>.[].name</code> from the first file is equals to <code>.features[].name</code> from the second file I concatenate its corresponding keys from the first file on the second file (considering that the value of <code>.[].name</code> on the first file is always unique). So the result would be the following:</p>
  <pre><code>{
      &quot;name&quot;: &quot;one&quot;,
      &quot;type&quot;: &quot;FeatureCollection&quot;,
      &quot;features&quot;: [
          {
              &quot;name&quot;: &quot;one&quot;,
              &quot;valueA&quot;: &quot;0&quot;,
              &quot;valueB&quot; : &quot;0&quot;,
              &quot;keyB&quot;: &quot;2&quot;,
              &quot;keyC&quot;: &quot;3&quot;
          },  
          {
              &quot;name&quot;: &quot;two&quot;,
              &quot;valueA&quot;: &quot;11&quot;,
              &quot;valueB&quot;: &quot;21&quot;,
              &quot;keyB&quot;: &quot;15&quot;,
              &quot;keyC&quot;: &quot;20&quot;
          },
          {
              &quot;name&quot;: &quot;one&quot;,
              &quot;valueA&quot;: &quot;21&quot;,
              &quot;valueB&quot;: &quot;30&quot;,
              &quot;keyB&quot;: &quot;2&quot;,
              &quot;keyC&quot;: &quot;3&quot;
          },  
          {
              &quot;name&quot;: &quot;two&quot;,
              &quot;valueA&quot;: &quot;1&quot;,
              &quot;valueB&quot;: &quot;2&quot;,
              &quot;keyB&quot;: &quot;15&quot;,
              &quot;keyC&quot;: &quot;20&quot;
          },
          {
              &quot;name&quot;: &quot;one&quot;,
              &quot;valueA&quot;: &quot;2&quot;,
              &quot;valueB&quot;: &quot;3&quot;,
              &quot;keyB&quot;: &quot;2&quot;,
              &quot;keyC&quot;: &quot;3&quot;
          },  
          {
              &quot;name&quot;: &quot;two&quot;,
              &quot;valueA&quot;: &quot;5&quot;,
              &quot;valueB&quot;: &quot;3&quot;,
              &quot;keyB&quot;: &quot;15&quot;,
              &quot;keyC&quot;: &quot;20&quot;
          }
      ]
  }
  </code></pre>
  <p>In this output, I just checked where the <code>name</code> is equal on both JSON files and then I brought the keys <code>keyB: &quot;2&quot;, &quot;keyC&quot;: &quot;3&quot;</code> where <code>name == &quot;one&quot;</code> and <code>keyB: &quot;15&quot;, &quot;keyC&quot;: &quot;20&quot;</code> where <code>name == &quot;two&quot;</code>. Is it possible to do with jq? Can I work with two JSON files in a way that I get parameters from one file to give it to another one?</p>