I am writing a simple program that will analyze a log file from a packet dump from wirehark into a more readable form. I am doing this with python.
I am currently stuck in this part:
for i in range(len(linelist)):
if '### SERVER' in linelist[i]:
packet = linelist[i:find("\n\n", i, len(linelist))]
linelist is a list created using the readlines () method, so each line in the file is an element in the list. I repeat it in all the ### SERVER meetings, and then grab all the lines after it until the next empty line (which means the end of the package). I have to do something wrong, because not only find () is not working, but I have a feeling that there is a better way to capture everything between ### SERVER and the next occurrence of an empty line.
Any ideas?
source
share