I have successfully got the C# StreamReader working:
using (StreamReader fileParser = new StreamReader(tbFileSelection.Text))
{
String line = fileParser.ReadToEnd();
Console.WriteLine(line);
}
I am currently writing each line of the file to the console. I now wish to go through each line and look for a specific tag — [TAG1] if the line starts with [TAG1] — I wish to display the entire line in the console. Please note, the file is not XML-based. Can anyone suggest a way forward with this idea? I believe I need to tokenize the string Line?
You can use
StartsWithmethod to do filtering from lines: