Thank you for quick reply, however this is not working as expected in my case , I have nested loop so it has deleted all together the big chunk of first level data.
Hi Scrutinizer, thank you again for your quick reply. yes option 'second' worked fine for me. I am going to try with larger file and let you know for any issues. It would be a great help if you can just explain what was your approach and syntax explanation for learner like me .
If you are doing a lot with JSON files in a shell-scripting environment, could I suggest installing jq ? It is certainly in the Ubuntu repositories and probably most other distribution repositories; and Mac users can install it with brew
I'm the same opinion as Andrew(apmd47). jq is the greatest command line tool for JSON-parsing and manipulation I know. It has a ton of possibilites to mangle / extract json data in this very small binary(<30K). It's written in portable c, with no runtime dependencies. See: jq