Python Forum
How to convert what appears to be a JSON file to CSV
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to convert what appears to be a JSON file to CSV
#1
Hi,
I have this file below, the format looks like it's JSON but I'm not sure, I want to convert it to csv.

I have also attached the file for clear readability.

Quote:(UserResponse){
UserData =
(UserData){
Entry[] =
(UserData){
Active = True
CreatedTime = 2014-07-05 18:38:59.062000+02:00
FirstName = "System"
Lastname = "Account (AddressBook)"
Locked = False
RoleNames =
(RoleNames){
Entry[] =
"Integration admin"
}
UserName = "User1"
UserOrganisation = "Default Organization"
}
(UserData){
Active = True
CreatedTime = 2014-07-05 18:38:59.062000+02:00
FirstName = "System"
LastLoginExt = 2019-04-13 20:04:03+02:00
Lastname = "Account (ChickenFeet)"
Locked = False
RoleNames =
(RoleNames){
Entry[] =
"Integration admin"
}
UserName = "User5"
UserOrganisation = "Default Organization"
}


}
}

please help, how do I convert this file to csv

Attached Files

.txt   JSONfile.txt (Size: 2.7 KB / Downloads: 190)
Reply
#2
rough pseudo code (2 methods):
Reply
#3
FWIW, the data you've shown isn't JSON. I don't know what format it is, but perhaps there's a library that parses it. Where did you get it?
Reply
#4
This is not JSON
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
json file usually has suffix .json, not .txt
and must be valid json code which your file is not.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  value null when update in json file 3lnyn0 6 296 Dec-30-2021, 05:52 PM
Last Post: ndc85430
  add dictionarie in json file 3lnyn0 6 275 Dec-23-2021, 04:04 AM
Last Post: Pedroski55
  Convert legacy print file to XLSX file davidm 1 475 Oct-17-2021, 05:08 AM
Last Post: davidm
  Help with reading json file hhchenfx 5 1,517 Jul-07-2021, 01:58 PM
Last Post: hhchenfx
Question convert unlabeled list of tuples to json (string) masterAndreas 4 2,955 Apr-27-2021, 10:35 AM
Last Post: masterAndreas
  Request for Python code - Features extraction from JSON file (cuckoo) thinker 1 860 Apr-07-2021, 04:40 PM
Last Post: Larz60+
  Yahoo_fin, Pandas: how to convert data table structure in csv file detlefschmitt 14 3,469 Feb-15-2021, 12:58 PM
Last Post: detlefschmitt
  Convert string to JSON using a for loop PG_Breizh 3 1,194 Jan-08-2021, 06:10 PM
Last Post: PG_Breizh
  Sort data from JSON file Dummy_in_programming 2 1,013 Jan-04-2021, 06:17 PM
Last Post: deanhystad
  Json File more pages #pandas #dataframe nio74maz 0 861 Dec-30-2020, 05:32 AM
Last Post: nio74maz

Forum Jump:

User Panel Messages

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