Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(maybe) JSON to CSV
#4
it's not all commas, just the ones before each closing }, e.g.

Output:
[ { "primaryAdmin": "padmin", "passwordExpiryDate": 1549837845656, "loginName": "test1", "loginLive": true, "lastSetDate": 1486679445656, "loginCat" : "TESTCAT", "contactEmail": "[email protected]", "genreName": "Trailblazer", "secondaryAdmin": "sadmin", "contactName": "Test Contact", "lastLoginTime" : 1486765411722, "peEnabled" : true }, { "primaryAdmin": "padmin2", "passwordExpiryDate": 1549837845656, "loginName": "test2", "loginLive": true, "lastSetDate": 1486679445656, "loginCat": "TESTCAT", "contactEmail": "[email protected]", "genreName": "Trailblazer", "secondaryAdmin": "sadmin2", "contactName": "Test Contact2", "lastLoginTime": 1486765411722, "peEnabled" : true } ]
in order to use json module you need to clean the file. depending on file size and your RAM you may do this in memory - i.e. read the file in a string, clean it and then load the string with json. If the file is BIG, you may have to reprocess the file.
Reply


Messages In This Thread
(maybe) JSON to CSV - by PythonNewbster - Sep-28-2017, 04:34 AM
RE: (maybe) JSON to CSV - by buran - Sep-28-2017, 07:10 AM
RE: (maybe) JSON to CSV - by PythonNewbster - Sep-28-2017, 03:52 PM
RE: (maybe) JSON to CSV - by buran - Sep-28-2017, 04:08 PM
RE: (maybe) JSON to CSV - by PythonNewbster - Oct-03-2017, 07:44 PM
RE: (maybe) JSON to CSV - by nilamo - Oct-03-2017, 07:55 PM
RE: (maybe) JSON to CSV - by buran - Oct-03-2017, 08:01 PM
RE: (maybe) JSON to CSV - by PythonNewbster - Oct-03-2017, 09:18 PM
RE: (maybe) JSON to CSV - by nilamo - Oct-03-2017, 09:57 PM
RE: (maybe) JSON to CSV - by PythonNewbster - Oct-03-2017, 10:01 PM
RE: (maybe) JSON to CSV - by buran - Oct-03-2017, 10:59 PM
RE: (maybe) JSON to CSV - by PythonNewbster - Oct-04-2017, 04:44 AM
RE: (maybe) JSON to CSV - by buran - Oct-04-2017, 06:30 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020