Re: How to parse XML file and save results as .txt or .csv?

2015-08-18 Thread harirammanohar159
On Tuesday, 18 August 2015 22:20:32 UTC+5:30, ryguy7272 wrote: > I am trying to parse this XML file. > http://www.usda.gov/oce/commodity/wasde/report_format/latest-July-2015-New-Format.xml > > I tried a bunch of things in R, and almost got it working, but it seems like > there was some issue wit

Re: parse xml

2011-10-03 Thread Adam Tauno Williams
Quoting 守株待兔 <1248283...@qq.com>: please click the http://www.secinfo.com/d14qfp.q9j.htm then ,click the following: 44: XML IDEA: Condensed Consolidating Statements of Income XML 5.11M (Details)--R158 there is the citigroup's annual financial report --statements of income,xml file.

parse xml

2011-09-30 Thread 守株待兔
please click the http://www.secinfo.com/d14qfp.q9j.htm then ,click the following: 44: XML IDEA: Condensed Consolidating Statements of Income XML 5.11M (Details)--R158 there is the citigroup's annual financial report --statements of income,xml file. how can i get a table of statemen

Re: parse xml

2010-10-15 Thread Hidura
First every element represents a node so you have to use value=n.childNodes[0].nodeValue with that you'll have the 5000 2010/10/15, kostia : > I have xml file: > > > 5 > > > I want to get the value of n (= 5) inside my python program, I'm > doing this: > > import xml.dom.minidom

Re: parse xml

2010-10-15 Thread kostia
Thank you all! -- http://mail.python.org/mailman/listinfo/python-list

Re: parse xml

2010-10-15 Thread MRAB
On 15/10/2010 18:49, kostia wrote: I have xml file: 5 I want to get the value of n (= 5) inside my python program, I'm doing this: import xml.dom.minidom from xml.dom.minidom import Node doc = xml.dom.minidom.parseString("boolean_width.xml") n = doc.getElementsByTagName("roo

Re: parse xml

2010-10-15 Thread Nitin Pawar
this is wrong xml.dom.minidom.parseString("boolean_width.xml") ... if u r parsing from String use string variable as argument or use parse only if parsing from file On Sat, Oct 16, 2010 at 12:07 AM, Andreas Waldenburger wrote: > On Fri, 15 Oct 2010 10:49:18 -0700 (PDT) kostia > wrote: > > > I h

Re: parse xml

2010-10-15 Thread Sudheer Satyanarayana
On 10/15/2010 11:19 PM, kostia wrote: I have xml file: 5 I want to get the value of n (= 5) inside my python program, I'm doing this: import xml.dom.minidom from xml.dom.minidom import Node doc = xml.dom.minidom.parseString("boolean_width.xml") Use parse to parse a file

Re: parse xml

2010-10-15 Thread Andreas Waldenburger
On Fri, 15 Oct 2010 10:49:18 -0700 (PDT) kostia wrote: > I have xml file: > > > 5 > > > I want to get the value of n (= 5) inside my python program, I'm > doing this: > > import xml.dom.minidom > from xml.dom.minidom import Node > doc = xml.dom.minidom.parseString("boolean_wi

parse xml

2010-10-15 Thread kostia
I have xml file: 5 I want to get the value of n (= 5) inside my python program, I'm doing this: import xml.dom.minidom from xml.dom.minidom import Node doc = xml.dom.minidom.parseString("boolean_width.xml") n = doc.getElementsByTagName("root")[0].firstChild.nodeValue.strip() pr

Re: parse xml with invalid chars

2010-06-04 Thread Someone Something
What d'ya mean hang? On Fri, Jun 4, 2010 at 10:16 AM, Roman Makurin wrote: > Hi all > > Last time i have a big problem, i need parse xml files > which have invalid xml chars outside of CDATA and xml > parser hangs everytime on such files. Is there any way > to parse su

Re: Parse xml file

2009-08-30 Thread Mag Gam
XML is a structured file. I never knew you can read it line by line and process. iterparse() More info on iterparse(): http://effbot.org/zone/element-iterparse.htm On Thu, Aug 27, 2009 at 10:39 AM, Stefan Behnel wrote: > loial wrote: >> Is there a quick way to retrieve data from an xml file in p

Re: Parse xml file

2009-08-27 Thread Stefan Behnel
loial wrote: > Is there a quick way to retrieve data from an xml file in python 2.4, > rather than read the whole file? ElementTree is available as an external package for Py2.4 (and it's in the stdlib xml.etree package since 2.5). It's pretty much the easiest way to get data out of XML files. I

Re: Parse xml file

2009-08-27 Thread Balamurugan S
On Thu, Aug 27, 2009 at 2:26 PM, loial wrote: > Is there a quick way to retrieve data from an xml file in python 2.4, > rather than read the whole file? Universal Feed parser can do the job for you. This can be imported and used in your python programs. For more information, http://www.feedparser

Parse xml file

2009-08-27 Thread loial
Is there a quick way to retrieve data from an xml file in python 2.4, rather than read the whole file? -- http://mail.python.org/mailman/listinfo/python-list

How to parse xml with ISO-8859-1 encoding using ElementTree and SimpleXMLTreeBuilder?

2008-05-13 Thread Zvi
Hi All, I got trouble parsing xml returned by web service. XML data contains characters above 128, so ET.fromstring throws an error. Error is thrown from python's xmllib.py file, where it detects char above 128. I am replacing utf-8 encoding string in returned xml with 'ISO-8859-1', and then I cal

Elementtree to parse xml

2008-03-31 Thread Doran, Harold
I received some help on list with sample code on how to parse through an xml file using element tree. I now have this working using toy examples nicely. However, when I work to apply this to my actual xml file, I am hitting a roadblock. Is anyone on the list able to look at an xml file that I can

Re: Parse XML using Python

2004-12-10 Thread Uche Ogbuji
This is a neat solution. You can parse any well-formed general entitity (e.g. Anil's document with multiple root nodes) in 4Suite 1.0a4: from Ft.Xml.Domlette import EntityReader s = """ eggs more eggs """ docfrag = EntityReader.parseString(s, 'http://foo/test/spam.xml') docfrag is now ready for

Re: Parse XML using Python

2004-12-09 Thread Anil
William Park wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > > I wanted to write a script that will read the below file: > > > > > > . > > > > > > > > .. > > > > .. > > > > > > > > .. > > > > .. > > > > .. > > > > . > > . > > > > . > > > > > > > > .. > > > > > > > > .. > > >

Re: Parse XML using Python

2004-12-09 Thread William Park
[EMAIL PROTECTED] wrote: > Hi, > > I wanted to write a script that will read the below file: > > > . > > > > .. > > .. > > > > .. > > .. > > .. > > . > . > > . > > > > .. > > > > .. > > > > > > .. > and so on > > The output of the script shud be > > ABC > ..EFGA >

Re: Parse XML using Python

2004-12-09 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > > > . > . > > > > .. > and so on an XML document can only have a single root element, but your example has at least two top-level elements (abcd and xyz). here is some elementtree code that handles this by wrapping your data in a "root" element. from elementtr

Re: Parse XML using Python

2004-12-09 Thread Jeremy Bowers
On Thu, 09 Dec 2004 06:00:27 -0800, Anil wrote: > > Thomas Guettler wrote: >> Hi, >> >> Here is an example how to use sax: >> >> http://pyxml.sourceforge.net/topics/howto/node12.html >> >> Thomas >> >> -- >> Thomas GÃttler, http://www.thomas-guettler.de/ > > > Could you please tell me how to a

Re: Parse XML using Python

2004-12-09 Thread Diez B. Roggisch
Anil wrote: > Could you please tell me how to achieve the below. > I am interested in getting the output like: > > ABC > EFGA --> child of ABC > ABDG --> child of AEFGA > MON --> child of ABC > A1 > FGA --> child of A1 > BG--> child of FGA print """ ABC EFGA --> child of

Re: Parse XML using Python

2004-12-09 Thread Anil
Thomas Guettler wrote: > Am Wed, 08 Dec 2004 23:25:49 -0800 schrieb anilby: > > > Hi, > > > > I wanted to write a script that will read the below file: > > Hi, > > Here is an example how to use sax: > > http://pyxml.sourceforge.net/topics/howto/node12.html > > Thomas > > -- > Thomas Güttler, http

Re: Parse XML using Python

2004-12-09 Thread Thomas Guettler
Am Wed, 08 Dec 2004 23:25:49 -0800 schrieb anilby: > Hi, > > I wanted to write a script that will read the below file: Hi, Here is an example how to use sax: http://pyxml.sourceforge.net/topics/howto/node12.html Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ -- http://mail.pyt

Parse XML using Python

2004-12-08 Thread anilby
Hi, I wanted to write a script that will read the below file: . .. .. .. .. .. . . . .. .. .. and so on The output of the script shud be ABC ..EFGA ABDG ..MON A1 ..FGA BG Please help me in writing a Python script for the above task. Regards, Anil. -- h