Split large XML file after string found

getereabe

New Member
What I have:A large XML file @ nearly 1 million lines worth of content. Example of content:\[code\]<etc35yh3 etc="numbers" etc234="a" etc345="date"><something><some more something></some more something></something></etc123><etc123 etc="numbers" etc234="a" etc345="date"><something><some more something></some more something></something></etc123><etc15y etc="numbers" etc234="a" etc345="date"><something><some more something></some more something></something></etc123>\[/code\]^ repeat that by 900k or so lines (content changing of course)What I need:Search the XML file for \[code\]"<etc123"\[/code\]. Once found move (write) that line along with all lines below it to a separate XML file.Would it be advisable to use a method such as File.ReadAllLines for the search portion? What would you all recommend for the writing portion. Line by line is not an option as far as I can tell as it would take much too long.
 
Back
Top