I need help converting a bunch of json strings to CSVs inside a loop
for (MyBusinessObj obj:MyBusinessObjects){
String json = convertBOToJson();
Need to add this to CSV (only one header row)
}
Each string looks like below:
String1 {"name":"Ram","Age":"80",".....}
String2 {"name":"Rick","Age":"67",".....}
I need a CSV like:
name age
Ram 80
Rick 67
Each string can be close to 50MB, and I could have millions of rows. so I cannot construct one giant JSON string so I can get a JSONArray. How do I add these strings to a CSV file?
I have to use base Java, or some common library like openCSV