I need to get all .txt
files in all subfolders of a specified folder so I do:
var files = Directory.GetFiles(reportsFolder, "*.txt", SearchOption.AllDirectories);
However, in some folders I also have files with extensions like .txt_TODO
, and these are also being retrieved by GetFiles
.
How can I skip these files?