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: 462)
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
  Errors using json file RonR 5 955 Oct-28-2025, 03:00 PM
Last Post: buran
  Convert JSON to CSV Linuxdesire 6 8,022 Oct-15-2025, 12:05 AM
Last Post: Pedroski55
  Convert Json to table formathttps://python-forum.io/thread-38313.html python_student 3 18,704 Dec-05-2024, 04:32 PM
Last Post: Larz60+
  JSON File - extract only the data in a nested array for CSV file shwfgd 2 2,250 Aug-26-2024, 10:14 PM
Last Post: shwfgd
  encrypt data in json file help jacksfrustration 1 3,568 Mar-28-2024, 05:16 PM
Last Post: deanhystad
Question [SOLVED] Correct way to convert file from cp-1252 to utf-8? Winfried 8 16,799 Feb-29-2024, 12:30 AM
Last Post: Winfried
  parse json field from csv file lebossejames 4 3,003 Nov-14-2023, 11:34 PM
Last Post: snippsat
  Convert File to Data URL michaelnicol 3 4,128 Jul-08-2023, 11:35 AM
Last Post: DeaD_EyE
  Python Script to convert Json to CSV file chvsnarayana 8 6,402 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Loop through json file and reset values [SOLVED] AlphaInc 2 7,587 Apr-06-2023, 11:15 AM
Last Post: AlphaInc

Forum Jump:

User Panel Messages

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