Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick way to parse 50,000+ line XML file

Status
Not open for further replies.

wardy66

Programmer
Jun 18, 2002
102
AU
Hello all

I've written a Perl script using XML::Simple to parse an XML file generated from a program running under a UNIX line command.

The file is over 50K lines longs and I need to parse 2 of them.

The problem is the time required. It is taking around 15 minutes just to convert the XML file to a hash. Once that's done, all my pointers and loops etc are taking only a second or two, so I'm happy with that.

The commands in question have an option as to whether they output the normal, human-readable format or XML. I wanted to use XML as occasionally a new release of software will move column positions or increase field widths. XML seemed a nice way around formatting changes.

I looked on CPAN for some XML modules and unfortunately there are too many for me to re-write the Perl to time each one of them.

I was hoping someone had an idea as to the speediest way to parse the files :)

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top