title: Read text file at specific line
body: <p>I have a text file which has more than 3000 lines. I am finding the number of lines using</p>
  
  <pre><code>string[] lines = File.ReadAllLines(myPath);
  var lineCount = lines.Length; 
  </code></pre>
  
  <p>Then I am generating a random number </p>
  
  <pre><code>Random rand = new Random();
  var lineToRead = rand.Next(1, lineCount);
  </code></pre>
  
  <p>Now I need to read the specific line that is generated by random number. I can do this using</p>
  
  <pre><code>string requiredLine = lines[lineToRead];
  </code></pre>
  
  <p>Because my file is big I don't think creating such a big array is efficient.  Is there a more efficient or easier way to do this?</p>