I have a log file that I am processing. This contains messages from and to a server (requests and responses).
The responses to requests may not be in order i.e. we can have a response to a request after several requests are sent, and in some error cases there may not be any response message.
The log file is usually 2MB+ in size, so I am trying to see if there is a way I can find a request message and its response and after I find this delete it from the logfile and again start at the beginning of the logfile for the next request / response message.
Is there a way to delete the lines from the file OR can anyone suggest a better way to go about this?