python parser project

View: New views
2 Messages — Rating Filter:   Alert me  

python parser project

by uche :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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  -  XML-SIG@...
http://mail.python.org/mailman/listinfo/xml-sig

Re: python parser project

by Jose Rivera Merla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <uraniumore238@...> 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  -  XML-SIG@...
http://mail.python.org/mailman/listinfo/xml-sig


_______________________________________________
XML-SIG maillist  -  XML-SIG@...
http://mail.python.org/mailman/listinfo/xml-sig