C# matching two text files, case sensitive issue
- by Mike
What i have is two files, sourcecolumns.txt and destcolumns.txt. What i need to do is compare source to dest and if the text doesnt match write out to a new file. The code below works except i have case sensitive issues like this:
CPI
Cpi
These say they dont match because of captial letters, any help is always thanked!
string[] sourcelinestotal = File.ReadAllLines(@"C:\testdirectory\" + "sourcecolumns.txt");
string[] destlinestotal = File.ReadAllLines(@"C:\testdirectory\" + "destcolumns.txt");
foreach (string sline in sourcelinestotal)
{
if(destlinestotal.Contains(sline))
{
}
else
{
File.AppendAllText(@"C:\testdirectory\" + "missingcolumns.txt", sline);
}
}