Python XML and tables using math

F

flebber

I am looking at a project that will import and modify an XML file and
then export it to a table. Currently a flat file table system should
be fine.

I want to export the modified data to the table and then perform a
handful of maths(largely simple statistical functions) to the data and
then print out the resultant modified tables.

I was planning on using Python 2.7 for the project.

Has anyone used a guide to acheive something similar? I would like to
read up on it so I can assess my options and best methods, any hints
or tips?
 
S

Stefan Behnel

flebber, 16.08.2010 05:30:
I am looking at a project that will import and modify an XML file and
then export it to a table. Currently a flat file table system should
be fine.

I want to export the modified data to the table and then perform a
handful of maths(largely simple statistical functions) to the data and
then print out the resultant modified tables.

I was planning on using Python 2.7 for the project.

Has anyone used a guide to acheive something similar? I would like to
read up on it so I can assess my options and best methods, any hints
or tips?

That can usually be done in a couple of lines in Python. The approach I
keep recommending is to use cElementTree (in the stdlib), potentially its
iterparse() function if the file is too large to easily fit into memory,
but the code won't change much either way.

You might want to skip through this list a bit, similar questions have been
coming up every couple of weeks. The responses often include mostly
complete implementations that you can borrow from.

Stefan
 
F

flebber

flebber, 16.08.2010 05:30:





That can usually be done in a couple of lines in Python. The approach I
keep recommending is to use cElementTree (in the stdlib), potentially its
iterparse() function if the file is too large to easily fit into memory,
but the code won't change much either way.

You might want to skip through this list a bit, similar questions have been
coming up every couple of weeks. The responses often include mostly
complete implementations that you can borrow from.

Stefan

okay I found http://effbot.org/zone/celementtree.htm so I will have a
read through there.

I have been creating an every expanding macro/VBA project in Excel and
due to slightly changin source document - the header order changes -
it causes the project to crash out.

I was hoping python and XML may be a bit more robust.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top