Splitting an XML file into smaller XML files
Posted: Wed Jan 02, 2019 1:20 pm
I am trying to split one XML file into multiple smaller XML files using PowerShell. There are a very large number of "PRINTER" nodes. I would like to create a new XML for every 150 "PRINTER" nodes. The Structure for the file is very simple like below:
Iv'e been trying to do this with substrings and creating new arrays but it's getting very messy and I'm still having trouble with it. Can anybody provide some insight into an easier way to do this?
Code: Select all
<PRINTERS>
<PRINTER text />
<PRINTER text />
<PRINTER text />
</PRINTERS>