I wanted to try my meager linq skills here ... I'm sure there is a more elegant solution, but here's mine:
string pattern = ".SUMMARY."; string[] awesomeFiles = System.IO.Directory.GetFiles("path\\to\\awesomefiles"); IEnumerable<string> sum_files = from file in awesomeFiles where file.ToUpper().Contains(pattern) select file; IEnumerable<string> other_files = from file in awesomeFiles where !file.ToUpper().Contains(pattern) select file;
This assumes that there are no files other than two in another directory, but you can customize the template here to suit your needs (ie add βAwesome.Fileβ to the top of the template.)
When you repeat the assembly of each of them, you should get what you need.
Todd richardson
source share