Hello, I have a file with a lot of lines and here is what I want to do

Here is an example of somelines in the file:



Note that the file sample has 5 lines.

I want to be able to tell my program to read if the line starts with PP until the string "PF" and put that total string in one line in a list or file.

So basically the result I'm searching is the following:

Suppose this is a list:


Right now I'm just able to put the first line when it stars with PP, but how do I make it to add the other characters until de "PF". Note that they are in another line of the file.

Thanks in advance.

Found the answer,

I basically do a FOR cycle to go through the list where I put all the lines of my file, then if the string started with PP I did a Console.Write, then I saved the next line to a string and performed a Split with paramter "PF", finally I added a Console.Write with the index[0] and that did the trick.

Hope it might help someone