ok, without giving away too much and a much simpler approach instead of reading line by line, although may need optimisation when u have had a hang of it:
1) open the input file
2) read into a
char[]
of appropriate size
3) convert to string
4) look for "SUCCESS"
5) and, read everything after that keyword
6) finally, write to the output file. DONE!!!