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: 315)
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
  encrypt data in json file help jacksfrustration 1 190 Mar-28-2024, 05:16 PM
Last Post: deanhystad
Question [SOLVED] Correct way to convert file from cp-1252 to utf-8? Winfried 8 791 Feb-29-2024, 12:30 AM
Last Post: Winfried
  parse json field from csv file lebossejames 4 725 Nov-14-2023, 11:34 PM
Last Post: snippsat
  Convert File to Data URL michaelnicol 3 1,149 Jul-08-2023, 11:35 AM
Last Post: DeaD_EyE
  Python Script to convert Json to CSV file chvsnarayana 8 2,495 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Loop through json file and reset values [SOLVED] AlphaInc 2 2,092 Apr-06-2023, 11:15 AM
Last Post: AlphaInc
  Converting a json file to a dataframe with rows and columns eyavuz21 13 4,394 Jan-29-2023, 03:59 PM
Last Post: eyavuz21
  validate large json file with millions of records in batches herobpv 3 1,260 Dec-10-2022, 10:36 PM
Last Post: bowlofred
  error handler appears to be turned off. How do I turn it back on? jpotter0 0 584 Nov-26-2022, 11:44 AM
Last Post: jpotter0
  Convert Excel file into csv with Pipe symbol.. mg24 4 1,323 Oct-18-2022, 02:59 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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