Huge XML file HELP!

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Huge XML file HELP!

Postby andy1989 » Wed Nov 02, 2011 3:58 pm

Hey,

I really need your help
I have this large 22GB XML file data I scraped and I need to replace some strings in it.
The problem is I tried several of XML editors and only one actually managed to only open the file (EmEditor). When I started to replace, it got stuck and closed (tried it many times).
I think I need a program that only opens part of the file each time replaces the string and then opens the next part and replaces the same string etc...

Can anyone help please?

Thanks in advance ;)
andy1989
Forum Newbie
 
Posts: 8
Joined: Sat Sep 24, 2011 12:36 pm

Re: Huge XML file HELP!

Postby pickle » Thu Nov 03, 2011 3:46 pm

Not sure about what desktop applications you can use. I'd guess pretty much anything will croak on a 22GB file.

There is a PHP library, XMLReader, that iterates through an XML file one node at a time, rather than loading the whole file into memory at once - which sounds like what you want.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
pickle
Briney Mod
 
Posts: 6430
Joined: Mon Jan 19, 2004 7:11 pm
Location: 53.01N x 112.48W

Re: Huge XML file HELP!

Postby Tipsacon » Thu Nov 10, 2011 11:12 am

The problem is in the size of your file (22GB is no joke). Try this XMLReader, it might help you.
Tipsacon
Forum Newbie
 
Posts: 1
Joined: Thu Nov 10, 2011 10:47 am

Re: Huge XML file HELP!

Postby Celauran » Thu Nov 10, 2011 11:14 am

PHP 5.6 released! August 28, 2014
PSA: PHP 5.3 end of life August 14, 2014.
User avatar
Celauran
Moderator
 
Posts: 3528
Joined: Tue Nov 09, 2010 3:39 pm
Location: Montreal, Canada


Return to Miscellaneous

Who is online

Users browsing this forum: No registered users and 0 guests