Skip to content

Instantly share code, notes, and snippets.

@AlbertoMonteiro
Created March 9, 2018 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AlbertoMonteiro/47bd971a509b04cd59614013c9ffb81b to your computer and use it in GitHub Desktop.
Save AlbertoMonteiro/47bd971a509b04cd59614013c9ffb81b to your computer and use it in GitHub Desktop.
Merge CSV Files
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