Parse large xml files

  • Thread starter Thread starter Howard
  • Start date Start date
H

Howard

I have some very large xml files that are over 2gb. I need to convert them
to a sql database. The file is so large that it crashes notepad every time i
tried to open it.
Anyone who has delt with large files please give me some advice.
 
Howard said:
I have some very large xml files that are over 2gb.

With very large files like this you'll have to use a SAX parser rather
than DOM. A DOM parser will open the whole file into memory at once,
which with a 2GB file is unlikely to be possible without crashing the
machine! SAX, however, will read in the file bit by bit as needed.

I believe that the C# equivalent of the Java SAX parser is XmlTextReader
(as opposed to XmlDocument), so perhaps you should start looking there.

HTH
 
Back
Top