how to skip lines in txt file
<p>Hey guys I've been having some trouble skipping some unnecessary lines from the txt file that I am reading into my program. The data has the following format:</p>

<pre><code>Line 1
Line 2
Line 3
Line 4

Line 5
Line 6
Line 7
Line 8
</code></pre>

<p>I want to read line 1, trim lines 3, 4 and the white space and then read line 5, trim lines 7 and 8. I have read something similar to this here on this website, however, that particular case was skipping the first 5 lines of the text file. This is what I have tried so far:</p>

<pre><code>         string TextLine;


        System.IO.StreamReader file =
           new System.IO.StreamReader("C://log.txt");
        while ((TextLine = file.ReadLine()) != null)
        {

            foreach (var i in Enumerable.Range(2, 3)) file.ReadLine();
            Console.WriteLine(TextLine);


        }
</code></pre>

<p>As you guys can see, for the range, I have specified the start as line 2 and then skip 3 lines, which includes the white space. However, that first parameter of Enumerable.Range does not seem to matter. I can put a 0 and it will yield the same results. As I have it right now, the program trims from the first line, until the number specified in the second parameter of the .Range function. Does anyone know of a way to get around this problem? Thanks</p>
