List<string> wordsList = new List<string>();
wordsList = File.ReadAllLines(inFilePath, Encoding.Unicode).ToList();
wordsList = wordsList.GroupBy(x => x.ToLower()).Select(grp => grp.FirstOrDefault()).OrderBy(x => x).ToList();
File.WriteAllLines(@"other.txt", wordsList, Encoding.Unicode);
List<string> wordsList_ = new List<string>();
wordsList_ =
File.ReadAllLines(inFilePath, Encoding.Unicode).ToList();
wordsList_ =
wordsList_.Distinct(StringComparer.CurrentCultureIgnoreCase).OrderBy(x =>
x).ToList();
File.WriteAllLines(outFilePath, wordsList_, Encoding.Unicode);
List<string> wordsList = new List<string>();
wordsList = File.ReadAllLines(inFilePath, Encoding.Unicode).ToList();
var result = wordsList.GroupBy(x => x.ToLower()).Select(grp =>
grp).OrderBy(x => x.Key);
using (StreamWriter sw = new
StreamWriter(outFilePath, false, Encoding.Unicode))
{
foreach (var
item in result)
{
sw.WriteLine(item.FirstOrDefault() + ‘\t‘ +
item.Count());
}
}