Python Forum

Full Version: How to convert what appears to be a JSON file to CSV
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
rough pseudo code (2 methods):
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?
This is not JSON
json file usually has suffix .json, not .txt
and must be valid json code which your file is not.