title: parsing JSON with missing fields
body: <p>I have json array with very dynamic field and some of the array doesn't have all the fields.
  Example :</p>
  <pre><code>[ 
  {
        &quot;Name&quot;: &quot;AFG LIMITED&quot;,
          &quot;Vendor ID&quot;: &quot;008343&quot;,
          &quot;EGID&quot;: &quot;67888&quot;,
           &quot;FID&quot;: &quot;83748374&quot;
       },
  {
          &quot;Name&quot;: &quot;ABC LIMITED&quot;,
          &quot;Vendor ID&quot;: &quot;008333&quot;,
          &quot;EGID&quot;: &quot;67888&quot;,
          &quot;AID&quot;: &quot;0000292&quot;
           &quot;FID&quot;: &quot;98979&quot;
      },
      ]
  </code></pre>
  <p>I need to extract particular key with header &amp; pipe delimiter like :Name|Vendor ID|EGID|AID(only present in second array).if any key is not present then it should have null value
  I was try to parse this with below code but it's breaking in the second line itself as AID is missing.</p>
  <pre><code>import json
  
  with open(&quot;sample.json&quot;, &quot;r&quot;) as rf:
      decoded_data = json.load(rf)
  
  # Check is the json object was loaded correctly
  try:
      for i in decoded_data:
        print i[&quot;Name&quot;],&quot;|&quot;,i[&quot;Vendor ID&quot;]&quot;|&quot;,i[&quot;EGID&quot;],&quot;|&quot;,i[&quot;AId&quot;]
         
  except KeyError:
      print(null)
  </code></pre>
  <p>output from above code:
  AFG LIMITED|008343|67888|null</p>