I am trying to parse specific information from text files. I would like to be able to take the following text:
&15:44:25.3911456_0089& SIPEngine 0x208c N SIPUDPTransport::process_message() : remote=10.250.2.18:5060, message= To: sip:%QBE-JV9SKV1-SP%@10.250.2.18:5060;tag=6642 &15:44:31.7504799_0013& SIPEngine 0x2014 N SIPUDPTransport::process_message() : remote=10.250.2.85:5060, message= To: sip:%QBE-75FHBW1-SP%@10.250.2.85:5060;tag=11225
And parse it into the following data:
15:44:25.3911456_0089,QBE-JV9SKV1-SP
15:44:31.7504799_0013,QBE-75FHBW1-SP
The &
and %
were added to be there as delimiters. I can get creative with find and replace to add delimiters like this.
Any help on how to parse the data like this would be greatly appreciated. I have been trying to use SED
, FOR /F
, and other utilities but I haven't had much luck yet. The pattern of information will always repeat one after the other.
Essentially I am just trying to identify delimited strings within a text file and output them so I hope that this is something that can help others as well.
Thanks in advance for any help!