RyanAndres
asked on
Read large XML file with Powershell
I have a 500mb+ xml file I need to break apart, but every time I do Get-Content file it is too large for memory. Is there any way to process each node in the root one at a time similar to reading a stream?
The error: Exception of type 'System.OutOfMemoryExcepti on' was thrown.
The error: Exception of type 'System.OutOfMemoryExcepti
is this the kind of thing you are looking for? http://blogs.technet.com/b/stephap/archive/2009/05/27/choking-on-very-large-xml-files.aspx
ASKER
No, it uses $xml = [xml](gc file) ....
This is what I tried and it will load the entire file into memory.. which will cause the exception.
This is what I tried and it will load the entire file into memory.. which will cause the exception.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cool I used XmlTextReader and Writer.