title: Diff two files in different formats TXT/JSON
body: <p>I have two files which contain similar data but in different formats (JSON/TXT).</p>
  <p>file-A.json</p>
  <pre><code>        {
          &quot;Name&quot;: &quot;www.mydomain.com.&quot;,
          &quot;Type&quot;: &quot;A&quot;,
          &quot;TTL&quot;: 600,
          &quot;ResourceRecords&quot;: [
              {
                  &quot;Value&quot;: &quot;8.8.8.8&quot;
              }
          ]
      },
      {
          &quot;Name&quot;: &quot;other.domain.com.&quot;,
          &quot;Type&quot;: &quot;NS&quot;,
          &quot;TTL&quot;: 1800,
          &quot;ResourceRecords&quot;: [
              {
                  &quot;Value&quot;: &quot;123.reg.&quot;
              }
          ]
      }
  ]
  </code></pre>
  <p>}</p>
  <p>file-B.txt</p>
  <pre><code>www.mydomain.com 600 IN A 8.8.8.8
  other.domain.com 1800 IN NS 123.reg.
  </code></pre>
  <p>I'm trying to figure out the best method to diff both files so i can see if those records exist/match. However, as they are in different formats i'm not sure this is possible, so my idea was to parse both files to have an identical format then run diff on them but i don't know how to even start.</p>
  <p>I've been able to parse the json using jq to obtain specific records</p>
  <pre><code>cat file-B.json | jq '.ResourceRecordSets[] | {&quot;Name&quot;: .Name,&quot;ResourceRecords&quot;: .[]}' 
  </code></pre>
  <p>but starting to think this is not even the best approach.</p>