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:

PP923823u923729832
92832972323PF

PP0923802398203982
2320938209382PF

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:

PP923823u9237298329283297232
PP09238023982039822320938209382

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
Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.