Okay, got it committed. It seems to work okay with the test script. I've gone back to line-by-line parsing as Nico originally had it, so memory usage should be more rational. It still needs some cosmetic fixes and minor tweaks to bring it in line with PEAR coding standards (working on that now) but it should be fully functional in the way we discussed now. Let me know what you think...