I have a lot of reference files (in each file in the order of 50K lines), the point is that I have the parser walks along each link, and after he passed through it, preferably the line with this link from a file to delete, not to interfere. But the only algorithm I found in the Internet says that the entire file will have to unload in the array, from array to remove the desired rows, and then re-record all the contents of the array to a file. Is there no other way? The fact that my parser can fly so many different throw exception, and work will immediately cease. That is, to form the array during operation, and at the end it write to the file will not work, you need each iteration to do the overwrite, and that will take a lot of time and memory. Maybe something else to think of?
Thank you in advance!