1.In place of your list and counts you could create a class that contains two properties:
StringForSearch
and
Occurrence
(counter) then you could create the
List
of this object types;
2.For reading the file you could use StreamReader to read line by line like in the next example
using (StreamReader reader = new StreamReader("file.txt"))
{
string line;
while ((line = reader.ReadLine()) != null)
{
CompareLine(line, listOfStrings);
}
}
3.For comparing just pass the line read above to a method that use the list from the 1st point to search your initial text and to increment the counters for matching.