Hi again! I need to write code that reads a text file. I need to be able to parse the file based on the 1st character of every line. If the character is a “1”, skip to the next line, if it’s a “2”, read every line until another “1” appears at the start of another line. The code should repeat to the end of the file. How would I modify this code to do that?
[Code]
using (StreamReader sr=new StreamReadr(“test.txt”))
{
String line;
while ((line = sr.ReadLine()) != null)
{
Console.WriteLine(line);
}
Console.Read();
}
[/Code]