Looking for key words in a really long string

I have to make a statistical analysis from data of another program, wich saves logs in form of text. The idea is to paste the log in a textbox and solve everything with the code, so I'll have no trouble whenever I use it.
The text is really long, is there a limit for how long can the text be? If so, is there another solution for long strings?

Most of the lines (I'd say 70%) of the lines of the log have no information from the ones I need, so I assume removing those lines would make the string shorter and the program would run a lot faster, being the first step in the algorithm, and I can tell if the line has needed information on the 5th letter. Is it possible to remove lines of a string like that? This is easy I guess, but I just want to make sure before starting. Something like counting how many characters before the "\n" after "if" to check fifth letter and then decrease the position of every other by that amount.

Now the hardest part(Again, since I work with numbers the most, I can now just the basics of <string.h>). Is is possible to scan the text after removing the "useless" part checking for some key words and counting them?

I'm using Visual C++, Windows 7. I'm not very experienced with C++, but I've already read a lot and did some simple programs to get how it works, knowing C makes it simpler, but still there might be basic things I didn't learn.

Well this particular piece of code will really kill the performance.
Every time you want to delete something, you're copying the ENTIRE tail of the string. If this is megabytes in length, you're going to burn Watts of power (and hours of time) doing it.