Re: JSON Object to CSV Question

2015-08-19 Thread ryguy7272
On Thursday, June 18, 2015 at 2:59:11 AM UTC-4, kbtyo wrote: > Good Evening Everyone: > > > I would like to have this JSON object written out to a CSV file so that the > keys are header fields (for each of the columns) and the values are values > that are associated with each header field. Is t

Re: JSON Object to CSV Question

2015-06-20 Thread Saran Ahluwalia
Here is the dictionary that corresponds with the CSV printed to the console: 1. { 2. "PAC": { 3. "Account": [{ 4. "PC": "0", 5. "CMC": "0", 6. "WC": "0", 7. "DLA": "0", 8. "CN": null, 9. "FC": { 10. "Int32": ["0", 11. "0", 12. "0", 13. "0", 14. "0"] 15

Re: JSON Object to CSV Question

2015-06-20 Thread Ned Batchelder
On Saturday, June 20, 2015 at 2:10:51 AM UTC-4, Sahlusar wrote: > @Joonas: > > > The previous example was a typo. Please use the below example as a case > study.  > > > > > {'D_B': ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'], 'F_Int32': > ['0', '0', '0', '0', '0', '0', '0'

Re: JSON Object to CSV Question

2015-06-19 Thread Saran Ahluwalia
My answers are below in red. On Fri, Jun 19, 2015 at 2:47 PM, Joonas Liik wrote: > > You say you are taking this from an xml file and want to get a CSV file.. > > Why are you making an intermediate JSON file? > I thought that this would be the most efficient method as it emulates Python diction

Re: JSON Object to CSV Question

2015-06-19 Thread Saran Ahluwalia
@Joonas: The previous example was a typo. Please use the below example as a case study. 1. {'D_B': ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'], 2. 'F_Int32': ['0', 3. '0', 4. '0', 5. '0', 6. '0', 7. '0', 8. '0', 9. '0', 10. '0', 11. '0', 12. '0',

Re: JSON Object to CSV Question

2015-06-19 Thread Joonas Liik
this.. might not throw an eror, but you have 2 keys with the same name "F", and 1 of them will probably be disgarded..., you have data corruption even before you try to process it. { "F": "False", "F": { "Int32": ["0", "0", "0"] }, } you mentioned Excel at one point. perhaps you could mock up w

Re: JSON Object to CSV Question

2015-06-19 Thread Joonas Liik
You say you are taking this from an xml file and want to get a CSV file.. Why are you making an intermediate JSON file? Why do you need the CSV output? Could you perhaps be better off using another format? Your data seems to be a quite deeply nested hierarchical structure and doesn't seem to su

Re: JSON Object to CSV Question

2015-06-19 Thread Saran Ahluwalia
Hi Steven, Okay, I understand now how convoluted this sounds. Here is a more focused issue (I hope) referencing the following sample JSON object within a file: 1. "PAC": { 2. "Account": [{ 3. "PC": "0", 4. "CMC": "0", 5. "WC": "0", 6. "DLA": "0", 7. "CN": null, 8. "FC": {

Re: JSON Object to CSV Question

2015-06-19 Thread Steven D'Aprano
On Fri, 19 Jun 2015 07:50 pm, Saran Ahluwalia wrote: > If you read the most recent thread that I just posted it states far more > information The problem is, you are posting *too much* of the *wrong* information. The exception you are getting appears to be a simple one: you are getting the excep

Re: JSON Object to CSV Question

2015-06-19 Thread Sahlusar
On Friday, June 19, 2015 at 8:47:25 AM UTC-4, Sahlusar wrote: > On Friday, June 19, 2015 at 6:16:40 AM UTC-4, Cecil Westerhof wrote: > > Top posting is frowned upon. Could you put your reply under where you > > reply on next time? > > > > On Friday 19 Jun 2015 11:50 CEST, Saran Ahluwalia wrote: >

Re: JSON Object to CSV Question

2015-06-19 Thread Sahlusar
On Friday, June 19, 2015 at 6:16:40 AM UTC-4, Cecil Westerhof wrote: > Top posting is frowned upon. Could you put your reply under where you > reply on next time? > > On Friday 19 Jun 2015 11:50 CEST, Saran Ahluwalia wrote: > > > No I am not a troll. I am attempting to clarify an evolving problem

Re: JSON Object to CSV Question

2015-06-19 Thread Saran Ahluwalia
Thank you for clarifying. I will be more cognizant to follow this protocol. Sent from my iPhone > On Jun 19, 2015, at 6:07 AM, Cecil Westerhof wrote: > > Top posting is frowned upon. Could you put your reply under where you > reply on next time? > >> On Friday 19 Jun 2015 11:50 CEST, Saran Ah

Re: JSON Object to CSV Question

2015-06-19 Thread Cecil Westerhof
Top posting is frowned upon. Could you put your reply under where you reply on next time? On Friday 19 Jun 2015 11:50 CEST, Saran Ahluwalia wrote: > No I am not a troll. I am attempting to clarify an evolving problem. > If you read the most recent thread that I just posted it states far > more in

Re: JSON Object to CSV Question

2015-06-19 Thread Saran Ahluwalia
Steve, No I am not a troll. I am attempting to clarify an evolving problem. If you read the most recent thread that I just posted it states far more information - in my humble opinion. Peter was of great assistance. The data becomes more convoluted; as a fairly new programmer I am looking for

Re: JSON Object to CSV Question

2015-06-18 Thread Steve Hayes
On Wed, 17 Jun 2015 17:49:35 -0400, Saran Ahluwalia wrote: >Good Evening Everyone: > >I would like to have this JSON object written out to a CSV file so that the You've already said that in another thread, and got several answers. What are you? Some kind of troll? -- Steve Hayes from Tshwane,

Re: JSON Object to CSV Question

2015-06-18 Thread Peter Otten
Saran Ahluwalia wrote: > Good Evening Everyone: > > I would like to have this JSON object written out to a CSV file so that > the keys are header fields (for each of the columns) and the values are > values that are associated with each header field. Is there a best > practice for working with th

JSON Object to CSV Question

2015-06-18 Thread Saran Ahluwalia
Good Evening Everyone: I would like to have this JSON object written out to a CSV file so that the keys are header fields (for each of the columns) and the values are values that are associated with each header field. Is there a best practice for working with this? Ideally I would like to recursiv