Hi guys, im trying to make a console application which reads 2 text files and outputs it into one text file. The outputted text file needs to remove any replicates of data from the 2 text files. Was wondering if people could tell me whats wrong with my code -
Code:while (!sr.EndOfStream) { strList1.Add(sr.ReadLine()); } while (!sr2.EndOfStream) { strList2.Add(sr2.ReadLine()); } foreach (string st in strList2) { for (int i = 0; i < strList2.Count; i++) { if (sr.ReadLine() == st) { break; } sw.WriteLine(st); } foreach (string s in strList1) { sw.WriteLine(s); }




Reply With Quote