title: Converting csv row to JSON object in Java
body: <p>I've a csv file something similar to this </p>
  
  <pre><code>"name.firstName","name.givenName","name.DisplayName","phone.type","phone.value"
  "john","maverick","John Maverick","mobile","123-123-123"
  "jim","lasher","Jim Lasher","mobile","123-123-123"
  </code></pre>
  
  <p>I want to convert the 2nd and 3rd row into JSON objects.Using the first row as Header. So the result will be</p>
  
  <pre><code>[
  {  
  "name": {
      "firstName": "john",
      "givenName": "maverick",
      "DisplayName": "John Maverick"
  },
  "phone": {
      "type": "mobile",
      "value": "123-123-123"
  }
  },
  {
  "name": {
      "firstName": "john",
      "givenName": "maverick",
      "DisplayName": "John Maverick"
  },
  "phone": {
      "type": "mobile",
      "value": "123-123-123"
  }
  ]
  </code></pre>
  
  <p>Any idea how to achieve this?</p>