Re: python parser project
Jose Rivera Merla <[email protected]> Tue, 21 Jul 2009 17:09:50 -0500
| Newsgroups | gmane.comp.python.xml |
|---|---|
| Message-ID | <[email protected]> |
--===============1273011907==
Content-Type: multipart/alternative; boundary=001485f6470a6c65a8046f3e8332
--001485f6470a6c65a8046f3e8332
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi Uche:
Its my opinion that you coud do this easily with lxml for the XML part.
Just Google "Python LXML"
Look at this page http://codespeak.net/lxml/tutorial.html
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 <[email protected]> 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 - [email protected]
> http://mail.python.org/mailman/listinfo/xml-sig
>
--001485f6470a6c65a8046f3e8332
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi Uche:<div><br></div><div>=A0=A0 Its my opinion that you coud do this eas=
ily with lxml for the XML part. Just Google "Python LXML"</div><d=
iv><br></div><div>=A0=A0 Look at this page=A0<a href=3D"http://codespeak.ne=
t/lxml/tutorial.html">http://codespeak.net/lxml/tutorial.html</a></div>
<div>=A0=A0=A0</div><div>=A0=A0 The txt file is easy to handle with the spl=
it(',') command.</div><div><br></div><div>=A0=A0 The thing I don=
9;t know what you are talking it's about sending the XML to a SQL Datab=
ase, it's easier to handle the text file in SQL bulk insert command, et=
c..</div>
<div><br></div><div>Regards,</div><div>Jose Rivera<br><br><div class=3D"gma=
il_quote">On Tue, Jul 21, 2009 at 12:19 PM, uche <span dir=3D"ltr"><<a h=
ref=3D"mailto:[email protected]">[email protected]</a>></spa=
n> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">Hi All,<br>
<br>
I am developing a python parsing program. This program takes two<br>
inputs a comma dilimeted txt file and an xml file, which represents<br>
the structure of the datafile. I am using python minidom to read in<br>
the xml file and create a tree structure in an object file. The next<br>
thing to do is to insert the data into the respective fields of the<br>
tree. Once I am done, I'd like to send this object to an sql database.<=
br>
Has anyone attempted to do this ? Is there an example code online that<br>
I can reference to ? ... More specifically what code will allow me to<br>
combine the data and tree structure into a complete object that I can<br>
use to populate the sql database ?<br>
<br>
Thanks.<br>
_______________________________________________<br>
XML-SIG maillist =A0- =A0<a href=3D"mailto:[email protected]">XML-SIG@pyth=
on.org</a><br>
<a href=3D"http://mail.python.org/mailman/listinfo/xml-sig" target=3D"_blan=
k">http://mail.python.org/mailman/listinfo/xml-sig</a><br>
</blockquote></div><br></div>
--001485f6470a6c65a8046f3e8332--
--===============1273011907==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
XML-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
--===============1273011907==--