Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #92932

Re: JSON Object to CSV File Troubleshooting

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.python
Subject Re: JSON Object to CSV File Troubleshooting
Date 2015-06-21 06:50 +0000
Organization A noiseless patient Spider
Message-ID <mm5mr3$5m8$4@dont-email.me> (permalink)
References <d5bc266f-2e87-406f-b3f8-9c784112874b@googlegroups.com>

Show all headers | View raw


On Thu, 18 Jun 2015 18:47:30 -0700, Sahlusar wrote:

> I have a conundrum regarding JSON objects and converting them to CSV:
> 
> Context
> 
> I am converting XML files to a JSON object (please see snippet below)
> and then finally producing a CSV file. Here is a an example JSON object:

This is where you're going wrong. If you want CSV data, take the XML and 
generate CSV data from it. Converting and writing it out to JSON and then 
reading it back and converting to CSV involves an extra conversion step 
where errors can creep in.

If you want to convert XML to CSV, go straight from XML to CSV, there is 
little added value in using some arbitrary intermediate format unless 
you're actually going to use the data in the intermediate format for 
something other than converting to the final format.

-- 
Denis McMahon, denismfmcmahon@gmail.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

JSON Object to CSV File Troubleshooting Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-18 18:47 -0700
  Re: JSON Object to CSV File Troubleshooting Steve Hayes <hayesstw@telkomsa.net> - 2015-06-19 07:23 +0200
  Re: JSON Object to CSV File Troubleshooting Denis McMahon <denismfmcmahon@gmail.com> - 2015-06-21 06:50 +0000
  Re: JSON Object to CSV File Troubleshooting Denis McMahon <denismfmcmahon@gmail.com> - 2015-06-21 06:53 +0000
    Re: JSON Object to CSV File Troubleshooting Sahlusar <sahluwalia@wynyardgroup.com> - 2015-06-21 06:58 -0700
    Re: JSON Object to CSV File Troubleshooting Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-21 07:38 -0700
      Re: JSON Object to CSV File Troubleshooting Denis McMahon <denismfmcmahon@gmail.com> - 2015-06-21 21:06 +0000
      Re: JSON Object to CSV File Troubleshooting Joonas Liik <liik.joonas@gmail.com> - 2015-06-22 00:55 +0300
        Re: JSON Object to CSV File Troubleshooting Denis McMahon <denismfmcmahon@gmail.com> - 2015-06-21 23:33 +0000
          Re: JSON Object to CSV File Troubleshooting Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-21 16:56 -0700
            Re: JSON Object to CSV File Troubleshooting Denis McMahon <denismfmcmahon@gmail.com> - 2015-06-23 06:34 +0000
              Re: JSON Object to CSV File Troubleshooting Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-23 04:32 -0700
          Re: JSON Object to CSV File Troubleshooting Chris Angelico <rosuav@gmail.com> - 2015-06-23 10:43 +1000
        Re: JSON Object to CSV File Troubleshooting Sahlusar <ahlusar.ahluwalia@gmail.com> - 2015-06-21 16:42 -0700

csiph-web