title: Parsing JSON file and converting into csv file using jq
body: <p>I am trying to parse my data and convert them into multiple <strong>csv</strong> files, according to the section. </p>
  
  <h3>Sample JSON</h3>
  
  <pre><code>{
      "content": [
      {
          "Title": "abc",
          "brand": "xyz",
          "size": "5 g",
          "date": "2019-01-01",
          "details": {
              "Temperature": [
              {
                  "value": "90",
                  "chracterstics":"Normal"
              },
              {
                  "value":"100",
                  "chracterstics":"high"
              },
  
              {
                  "value":"80",
                  "chracterstics":"low"
              }
              ],
  
              "certifications": [
              {
                  "value": "based",
                  "chracterstics":"pass"
              },
  
              {
                  "value": "50",
                  "chracterstics":"failed"
              }
              ]
          },
  
           "formats": {
              "city": "NYC",
              "id": "007",
              "manufacture":""
              },
          "innerDetails": [
          {
              "contains": "abc",
              "panel":"xyz",
              "values":[
                  {
                      "name":"abc",
                      "value":"10"
                  },
                  {
                      "name":"xyz",
                      "value":"20"
                  }
                  ]
              }
          ]
  }
  ]
  }
  </code></pre>
  
  <p>I am trying to put the content data into one <strong>csv</strong> file, Temperature data into second <strong>csv</strong> file, certifications into third, formats and inner details data in other separate file.</p>
  
  <p>I have tried the below approach, but getting "Cannot index array with string "brand"" error.</p>
  
  <pre><code>jq -r '.[]|[.Title,.brand,.size,.date]|@csv' $jsonfile &gt; sample.csv.
  </code></pre>
  
  <p>I was trying on the same line with other sections, but getting the same error.</p>
  
  <p>How do I solve this issue?</p>