I have a .JSON
file (maybe wrong JSON
structure file, but the extension is .JSON
) When I use JSON beautifier
we see as below:
object {2}
https://example.com/product/Detail/1 [3]
https://example.com/product/Detail/2 [3]
Each of above lines has Three (3) details (Property)
:
https://example.com/product/Detail/1 [3]
0 : ACETATE
1 : SUSPENSION PARENTERAL 40 mg/1mL
2 : INJECTION
without any consideration that this is a correct JSON file or not, I need an .xlsx
file and so try to convert it using JSON
to CSV
or EXCEL
Online tools and see following:
as we can see there is wrong conversion
, we should have:
I means we should have two (2) rows
and for each row we should have three (3) columns
(property).
What is the easiest way to convert this .JSON file to Excel to get the above (Second picture)? is there any piece of code, scripts, or tools to can handle it easily?
Update:
This is the JSON file for two records.
{
"https://example.com/product/Detail/1": [
"METHYLPREDNISOLONE ACETATE",
"METHYLPREDNISOLONE ACETATE INJECTION, SUSPENSION PARENTERAL 40 mg/1mL",
"INJECTION, SUSPENSION",
"PARENTERAL",
"البرز دارو",
"البرز دارو",
"ریال",
"ریال",
"1 AMPULE in 1 CARTON",
"METHYLPREDNISOLONE ACETATE 40 mg/1mL",
"1397/12/24",
"60000",
"60000",
"06260152433031",
"3230858996456396",
"",
"H02AB04"
],
"https://example.com/product/Detail/2": [
"METHYLPREDNISOLONE ACETATE",
"METHYLPREDNISOLONE ACETATE INJECTION, SUSPENSION PARENTERAL 40 mg/1mL",
"INJECTION, SUSPENSION",
"PARENTERAL",
"کارخانجات دارو پخش",
"کارخانجات دارو پخش",
"ریال",
"ریال",
"1 AMPULE in 1 BOX",
"METHYLPREDNISOLONE ACETATE 40 mg/1mL",
"1400/09/22",
"60000",
"60000",
"06260132425704",
"2903849236347759",
"",
"H02AB04"
]
}