I have a text file in which a particular character repeats at the start of the line after every few lines. the no. of lines in between is not fixed. I am able to find out those lines where this condition occurs. I want to read those lines in between.
using (StreamReader sr = new StreamReader(@"text file"))
{
string line;
while ((line = sr.ReadLine()) != null)
{
if (line.StartsWith("some character"))
Because the next time, this character occurs, the code remains same. I am not able to read those lines in between
For eg.
Condition at the begining of a line
Next line
Next line
Condition at the begining of a line
Next Line
Next Line
Next Line
Next Line
Condition at the begining of a line
I have to read lines in between. The condition remains same every time. Thanks.