For those of you with perl on your PC, the below code allows you to make your own custom sort by using parts.xml. It will write parts.lst to the screen so must be directed to parts.lst. Simply change $Level1, $Level2 and $Level3 to alter your sorting style.
Run as: perl SortParts.pl > parts.lst
Run as: perl SortParts.pl > parts.lst
Code:
use XML::Simple;
# Sort by category, then filename, then description
$Level1="Category";
$Level2="Description";
$Level3="NameEntry";
sub CmpParts {
# Sort at first level
$c=$a->{$Level1} cmp $b->{$Level1};
if ($c==0) {
$c=$a->{$Level2} cmp $b->{$Level2};
if ($c==0) {
$c=$a->{$Level3} cmp $b->{$Level3};
}
}
return $c;
}
$xml=new XML::Simple;
$data=$xml->XMLin("parts.xml");
@PEArray = @{$data->{"FileEntry"}};
@PEArraySorted=sort CmpParts @PEArray;
foreach $P (@PEArraySorted) {
print( sprintf("%-27s", $P->{"NameEntry"}).$P->{"Description"}."\n" );
}