C or C++
I have a text file with a list of several thousand packets, I would like to read through the text file, find relevant packets(peices of text) and write these to another file.
The packets I require look like this:
Packet #4
Flags: 0x00
Status: 0x01
Packet Length:572
Timestamp: 11:00:59.660120 03/29/2002
HTTP - HyperText Transfer Protocol
GET /dsmith/Trav 47 45 54 20 2F 64 73 6D 69 74 68 2F 54
el.asp HTTP/1.1. 65 6C 2E 61 73 70 20 48 54 54 50 2F 31
Accept: */*.. 41 63 63 65 70 74 3A 20 2A 2F 2A 0D 0A
UA-OS: Windows C 55 41 2D 4F 53 3A 20 57 69 6E 64 6F 77 Referer: http:// 52 65 66 65 72 65 72 3A 20 68 74 74 70 3A
Frame Check Sequence: 0x00000000
I would like to write relevant packets to another file, I only need some info from the packets, the information I need is:
the packet number, time stamp and the url for the GET call.
I have tried reading the text in as an array and then searching for a sub set, but cannot get the relevant info. Does anyone have any ideas?
I have a text file with a list of several thousand packets, I would like to read through the text file, find relevant packets(peices of text) and write these to another file.
The packets I require look like this:
Packet #4
Flags: 0x00
Status: 0x01
Packet Length:572
Timestamp: 11:00:59.660120 03/29/2002
HTTP - HyperText Transfer Protocol
GET /dsmith/Trav 47 45 54 20 2F 64 73 6D 69 74 68 2F 54
el.asp HTTP/1.1. 65 6C 2E 61 73 70 20 48 54 54 50 2F 31
Accept: */*.. 41 63 63 65 70 74 3A 20 2A 2F 2A 0D 0A
UA-OS: Windows C 55 41 2D 4F 53 3A 20 57 69 6E 64 6F 77 Referer: http:// 52 65 66 65 72 65 72 3A 20 68 74 74 70 3A
Frame Check Sequence: 0x00000000
I would like to write relevant packets to another file, I only need some info from the packets, the information I need is:
the packet number, time stamp and the url for the GET call.
I have tried reading the text in as an array and then searching for a sub set, but cannot get the relevant info. Does anyone have any ideas?