title: jq - retrieve values from json table on one line for specific columns
body: <p>I'm trying to get cell values from a json formatted table but only for specific columns and have it output into its own object.</p>
  <p>json example -</p>
  <pre><code>{
     &quot;rows&quot;:[
        {
           &quot;id&quot;:409363222161284,
           &quot;rowNumber&quot;:1,
           &quot;cells&quot;:[
              {
                 &quot;columnId&quot;:&quot;nameColumn&quot;,
                 &quot;value&quot;:&quot;name1&quot;
              },
              {
                 &quot;columnId&quot;:&quot;infoColumn&quot;,
                 &quot;value&quot;:&quot;info1&quot;
              },
              {
                 &quot;columnId&quot;:&quot;excessColumn&quot;,
                 &quot;value&quot;:&quot;excess1&quot;
              }
           ]
        },
        {
           &quot;id&quot;:11312541213,
           &quot;rowNumber&quot;:2,
           &quot;cells&quot;:[
              {
                 &quot;columnId&quot;:&quot;nameColumn&quot;,
                 &quot;value&quot;:&quot;name2&quot;
              },
              {
                 &quot;columnId&quot;:&quot;infoColumn&quot;,
                 &quot;value&quot;:&quot;info2&quot;
              },
              {
                 &quot;columnId&quot;:&quot;excessColumn&quot;,
                 &quot;value&quot;:&quot;excess2&quot;
              }
           ]
        },
        {
           &quot;id&quot;:11312541213,
           &quot;rowNumber&quot;:3,
           &quot;cells&quot;:[
              {
                 &quot;columnId&quot;:&quot;nameColumn&quot;,
                 &quot;value&quot;:&quot;name3&quot;
              },
              {
                 &quot;columnId&quot;:&quot;infoColumn&quot;,
                 &quot;value&quot;:&quot;info3&quot;
              },
              {
                 &quot;columnId&quot;:&quot;excessColumn&quot;,
                 &quot;value&quot;:&quot;excess3&quot;
              }
           ]
        }
     ]
  }
  </code></pre>
  <p>Ideal output would be filtered by two columns - <strong>nameColumn</strong>, <strong>infoColumn</strong> - with each row being a single line of the values.</p>
  <p>Output example -</p>
  <pre><code>{ 
    &quot;name&quot;: &quot;name1&quot;,
    &quot;info&quot;: &quot;info1&quot;
  }
  {
    &quot;name&quot;: &quot;name2&quot;,
    &quot;info&quot;: &quot;info2&quot;
  }
  { 
    &quot;name&quot;: &quot;name3&quot;,
    &quot;info&quot;: &quot;info3&quot;
  }
  </code></pre>
  <p>I've tried quite a few different combinations of things with select statements and this is the closest I've come but it only uses one.</p>
  <pre><code>jq '.rows[].cells[] | {name: (select(.columnId==&quot;nameColumn&quot;) .value), info: &quot;infoHereHere&quot;}'
  
  { 
    &quot;name&quot;: &quot;name1&quot;,
    &quot;info&quot;: &quot;infoHere&quot;
  }
  {
    &quot;name&quot;: &quot;name2&quot;,
    &quot;info&quot;: &quot;infoHere&quot;
  }
  { 
    &quot;name&quot;: &quot;name3&quot;,
    &quot;info&quot;: &quot;infoHere&quot;
  }
  </code></pre>
  <p>If I try to combine another one, it's not so happy.</p>
  <pre><code>jq -j '.rows[].cells[] | {name: (select(.columnId==&quot;nameColumn&quot;) .value), info: (select(.columnId==&quot;infoColumn&quot;) .value)}'
  </code></pre>
  <p>Nothing is output.</p>
  <p>** Edit **
  Apologies for being unclear with this. The final output would ideally be a csv for the selected columns values</p>
  <pre><code>name1,info1
  name2,info2
  </code></pre>