Created
March 9, 2018 12:27
-
-
Save AlbertoMonteiro/47bd971a509b04cd59614013c9ffb81b to your computer and use it in GitHub Desktop.
Merge CSV Files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.WriteAllLines(@"e:\resumo.txt", Directory.EnumerateFiles(@"E:\dados", "*.txt", SearchOption.AllDirectories) | |
.SelectMany(File.ReadLines) | |
.Select(s => s.Trim()) | |
.Where(s => !string.IsNullOrWhiteSpace(s)) | |
.Distinct() | |
.OrderBy(x => x)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment