title: How do I convert my .txt file to .json in bash?
body: <p>I have a text file like this,</p>
  <pre><code>Name: john 
  ...some random characters
  Title: Dev
  ...some random characters
  Country: Iceland
  ...some random characters
  Name: randy
  ...
  Title: Professor
  ...
  Country: Greenland
  ...
  </code></pre>
  <p>I am looking for a way to convert this into json like this,</p>
  <pre><code>{
  Name: john,
  Title: Dev,
  Country: Iceland
  },
  {
  Name: randy,
  Title: Professor,
  Country: Greenland
  }
  </code></pre>
  <p>There's always one line of extra random characters between each important line.</p>
  <p>I am kind of new to bash and having a hard time figuring out how to do this so I was hoping if someone here could help me.</p>
  <p>I tried this command but didn't work,</p>
  <pre><code>jq -Rs '[ split(&quot;\n&quot;)[] | select(length &gt; 0) | split(&quot;:&quot;) | {Name: .[0], Title: .[1], Country: .[2]}]' text.txt
  </code></pre>