Sort Data Files based on game name
Issue #5950
new
Is it possible to sort data files? Every time I close and re-open the xml order is scrambled making diffing impossible. I wrote sorters in powershell, but I would prefer it just saved in same order.
Comments (3)
-
reporter -
reporter Here’s the powershell code I use
[xml] $xw = New-Object System.Xml.XmlDocument $xw.LoadXml('<?xml version="1.0" standalone="yes"?><LaunchBox></LaunchBox>'); [System.Xml.XmlNode] $rootNode = $xw.DocumentElement; #iterate each game Node in Sorted Order Foreach($gameNode in $xr.LaunchBox.Game | sort Title) { #$gamePath = $gameNode.AppPath $newNode = $xw.ImportNode($gameNode, $true) $rootNode.AppendChild($newNode); }
\$xw.Save($FullPath);
-
- marked as trivial
- Log in to comment
clarification: I mean the contents of the the data files under \data\