I have over a thousand folders, each folder contains one or more files with the following names:
Unordered:
Alison.ext Heather.ext Molly.ext Paula.ext Sam.ext
List sortKeys = new List { 'M', 'S', 'H', 'A', 'P' };
sortKeys.Reverse();
List files = new List(6);
foreach(char sortKey in sortKeys)
{
var topFiles = files.Where(file => file.Name.StartsWith(sortKey.ToString()));
var remainingFiles = files.Except(topFiles);
files = topFiles.Concat(remainingFiles).ToList();
}
Untested and I'm sure there are faster ways, but at least it's with linq stuff as you asked :-)
edit: I just saw the edit on your post and now I don't have any idea anymore what you really want to do, so my code is probably useless to you..