Link to home
Create AccountLog in
Avatar of SiemensSEN
SiemensSEN

asked on

Parse json file to HTML table

Hello,
  I json file  with the following data:
"Summary":"A test json file",
  "uniq": {
    "fileA": {
      "Duplicates":"2",
      "DuplicateFiles":[
         {"File":"FileA1"},
         {"File":"FileA2"}
      ]
    },
    "FileB": {
      "Duplicates":"2",
      "DuplicateFiles":[
         {"File":"FileB1
         {"File":"FileB2
      ]
    },
    "FileC": {
      "Duplicates":"0",
      "DuplicateFiles":[
      ]
    },
    "FileD": {
      "Duplicates":"4",
      "DuplicateFiles":[
         {"File":"FileD1"},
         {"File":"FileD2"},
		  {"File":"FileD3},
		   {"File":"FileD4},
      ]
    }
 }
 }

Open in new window


I would like to parse it and display the content in an HTML table
E.G
Summary:

FILE  CNT   DUP
fileA  2       FileA1
                  FileA2
FileB  2      FileB1
                  FileB2
FileC   0
FileD   4    FileD1
                 FileD2
                 FileD3
                 FileD4


How can I parse the file to get the output. Also, is there better output format for the JSON file that would make creating the table easier.

Thanks for your help
ASKER CERTIFIED SOLUTION
Avatar of SANDY_SK
SANDY_SK
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.