Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var regexTest = new Func<string, bool>(i => Regex.IsMatch(i, @"Awesome.File.(Summary)?.[d]+_[d]+.txt", RegexOptions.Compiled | RegexOptions.IgnoreCase));
- var files = Directory.GetFiles(@"c:pathtofolder").Where(regexTest);
- 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;
Add Comment
Please, Sign In to add comment