skip to Main Content

How to change an unnormalized csv file to a complex json or java object

I have the following unnormalized csv file user_id,nickname,joinDate,product_id,price 1,kmh,2023-07-24,P131,3000 1,kmh,2023-07-24,P132,4000 1,kmh,2023-07-24,P133,7000 1,kmh,2023-07-24,P134,9000 2,john,2023-07-24,P135,2500 2,john,2023-07-24,P136,6000 3,alice,2023-07-25,P137,4500 3,alice,2023-07-25,P138,8000 I'm going to change this to the following json format (or java object). [ { "user_id": 1, "nickname": "kmh", "joinDate": "2023-07-24", "orders": [ {…

VIEW QUESTION

Unable to Deserialize Json data

I have a JSON data, which I want to Deserialize and load. I'm able to Deserialize and load with partial data, but not with all. Below is the code and the JSON data. public class Category { public string CategoryID…

VIEW QUESTION

Loop over JSON arrays in python

I wanted to loop over a section in my JSON File and render the geometry based on their names in the File. main.py import json data = json.load(open('src/test.json')) for geo in data["geometry"]: if geo == "rect: Geometry.rectangle(draw=pen, x=geo["x"], y=geo["y"], width=geo["width"],…

VIEW QUESTION

Json – Flatten multiple arrays keeping order

I have a json object like: { "Nemo": [ 3694756688, 3694756832, 3694756650 ], "Firefox": [ 3694756795, 3694756407, 3694756412, 3694756395 ], "Codium": [ 3694756035, 3694756383, 3694756378 ], "Terminals": [ 3694756804, 3694756802, 3694756428 } I need output like: 3694756688 3694756832 3694756650 3694756795…

VIEW QUESTION
Back To Top
Search