title: Quick search for line in sorted 5 GB file
body: <p>I have to determine if a given line (as string) exists in a sorted text file. The data on this file changes every day and, on average, there are 152 million records and the file weighs approximately 5GB. The file is alphabetically ordered and records are separated by a new line.</p>
  <p><strong>Example</strong>: search hello</p>
  <p><strong>File:</strong><br/>
  apple<br/>
  banana<br/>
  catsup<br/>
  dog<br/>
  hello<br/></p>
  <p>I don't need to search the entire file. Once I found an exact name, it can return either a string or int. Just to prove its existence.</p>
  <p>I have tried the following:</p>
  <pre><code>using (var sr = new StreamReader(txtFile))
  {
     string line;
     while ((line = sr.ReadLine()) != null)
     {
         if (line == searchedWord)
             return true;
     }
     return false;
  }
  </code></pre>
  <pre><code>int result = File.ReadLines(txtFile).Count(line =&gt; line.Equals(searchedWord));
  if (result &gt; 0)
     return true;
  return false;
  </code></pre>
  <p>My question is: Is there a better solution to find the line?</p>