title: Parsing Complex JSON in Scala
body: <p>I have the below JSON field in my data.</p>
  
  
  
  <pre class="lang-scala prettyprint-override"><code>val myjsonString = """[{"A":[{"myName":"Sheldon""age":30"Qualification":"Btech"}]"B":"UnitedStates"},{"A":[{"myName":"Raj""age":35"Qualification":"BSC"}]"B":"UnitedKIngDom"},{"A":[{"myName":"Howard""age":40"Qualification":"MTECH"}]"B":"Australia"}] """
  </code></pre>
  
  <p>The parse method gives the following structure:</p>
  
  <pre class="lang-scala prettyprint-override"><code>scala &gt; val json = parse(myjsonString)
  json: org.json4s.JValue = JArray(List(JObject(List((A,JArray(List(JObject(List((myName,JString(Sheldon)), (age,JInt(30)), (Qualification,JString(Btech))))))), (B,JString(UnitedStates)))), JObject(List((A,JArray(List(JObject(List((myName,JString(Raj)), (age,JInt(35)), (Qualification,JString(BSC))))))), (B,JString(UnitedKIngDom)))), JObject(List((A,JArray(List(JObject(List((myName,JString(Howard)), (age,JInt(40)), (Qualification,JString(MTECH))))))), (B,JString(Australia))))))
  </code></pre>
  
  <p>I am trying to parse it using Scala <code>json4s</code>. Visited almost all previously asked questions related to this, however, could not get proper solution to this. The O/P should be something like this:-</p>
  
  <pre class="lang-scala prettyprint-override"><code>UnitedStates 30
  UnitedKIngDom 35
  Australia 40
  </code></pre>
  
  <p>or only the age in <code>30#35#45</code> format.</p>