python parser project

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

python parser project

uche
Hi All,

I am developing a python parsing program. This program takes two
inputs a comma dilimeted txt file and an xml file, which represents
the structure of the datafile. I am using python minidom to read in
the xml file and create a tree structure in an object file. The next
thing to do is to insert the data into the respective fields of the
tree. Once I am done, I'd like to send this object to an sql database.
Has anyone attempted to do this ? Is there an example code online that
I can reference to ? ... More specifically what code will allow me to
combine the data and tree structure into a complete object that I can
use to populate the sql database ?

Thanks.
_______________________________________________
XML-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/xml-sig
Reply | Threaded
Open this post in threaded view
|

Re: python parser project

Jose Rivera Merla
Hi Uche:

   Its my opinion that you coud do this easily with lxml for the XML part. Just Google "Python LXML"

   
   The txt file is easy to handle with the split(',') command.

   The thing I don't know what you are talking it's about sending the XML to a SQL Database, it's easier to handle the text file in SQL bulk insert command, etc..

Regards,
Jose Rivera

On Tue, Jul 21, 2009 at 12:19 PM, uche <[hidden email]> wrote:
Hi All,

I am developing a python parsing program. This program takes two
inputs a comma dilimeted txt file and an xml file, which represents
the structure of the datafile. I am using python minidom to read in
the xml file and create a tree structure in an object file. The next
thing to do is to insert the data into the respective fields of the
tree. Once I am done, I'd like to send this object to an sql database.
Has anyone attempted to do this ? Is there an example code online that
I can reference to ? ... More specifically what code will allow me to
combine the data and tree structure into a complete object that I can
use to populate the sql database ?

Thanks.
_______________________________________________
XML-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/xml-sig


_______________________________________________
XML-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/xml-sig