Re: XML -> Tab-delimited text file (using lxml)

2008-11-19 Thread Gibson
On Nov 19, 11:03 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > Use iterparse() instead of parsing the file into memory completely. > > *stuff* > > Stefan That worked wonders. Thanks a lot, Stefan. So, iterparse() uses an iterate -> parse method instead of parse() and iter()'s parse -> iterate

Re: XML -> Tab-delimited text file (using lxml)

2008-11-19 Thread Stefan Behnel
Gibson wrote: > I'm attempting to do the following: > A) Read/scan/iterate/etc. through a semi-large XML file (about 135 mb) > B) Grab specific fields and output to a tab-delimited text file > [...] > out = open('output.txt','w') > cat = etree.parse('catalog.xml') Use iterparse() instead of pa

XML -> Tab-delimited text file (using lxml)

2008-11-19 Thread Gibson
I'm attempting to do the following: A) Read/scan/iterate/etc. through a semi-large XML file (about 135 mb) B) Grab specific fields and output to a tab-delimited text file The only problem I'm having is that the tab-delimited text file requires a different order of values than which appear in the X