-1

Based on key values i designed an excel reader function and this works for simple APIs but how do i read when an API has key value and nested key values within that. Ex :

{  
   "name":"test",
   "salary":"123",
   "age":"23",
   "address":{  
      "id":null,
      "name":"chethan",
      "address1":"89 6th cross",
      "address2":"AGS Road",
      "address3":"RR nagar",
      "city":"Bangalore",
      "pincode":"560061",
      "contactNumber":"1234567890"
   }
}

this is how i have saved excel file

I am reading each cell value from the excel and storing it as key value in a hashmap but i am not able to handle when it comes to nested key values ie i can read emp_name as key and 'chethan' as value but when it comes to address as key I am stuck. Can anyone please help me out to read these kind of nested key values from the excel file?

1 Answer 1

0

Try to read the object as JSON and then use JSON parsing libraries to retrieve what you require.

You can refer to this post to get JSON from your csv file.

Parse csv data and convert to nested json java

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.