title: Reading lines of text from file with Using and Yield Return
body: <p>I have the method below which uses Yield Return to read large ( >1m ) lines of text from a file.</p>
  
  <pre><code>    private static IEnumerable&lt;string&gt; ReadLineFromFile(TextReader fileReader)
      {
          using (fileReader)
          {
              string currentLine;
              while ((currentLine = fileReader.ReadLine()) != null)
              {
                  yield return currentLine;
              }
          }
      }
  </code></pre>
  
  <p>I need to be able to write every 10 lines returned from this method to different files.</p>
  
  <p>How do I consume this method without enumerating all the lines?</p>
  
  <p>Any answer is very much appreciated.</p>