samintz
Scott Mintz
- May
- 1,590
- 27
I have a file filled with a bunch of debug output. I want to filter the file and only pull out the lines corresponding to the values that are transmitted.
For example:
or
I want to pull out all the T: lines. In the first example, it's pretty easy because it's a single line. In the second example, it's spread over three lines.
This matches all the lines that start with T:
And this matches all the multi-line output but only displays the first line:
How do I get all three (or more) lines of a multiline match?
-Scott
For example:
Code:
Message transmitted: Thu Feb 02 16:09:57.552 2012 Thread ID 0x00001cc8
ASA Unconnected message: Get Attributes All Device
T: 01 02 20 01 24 01
received: Thu Feb 02 16:09:57.559 2012
R: 81 00 00 00 01 00 0e 00 60 00 15 01 70 30 4b 4c 69 00 1c 44 42 5f 31 37 35
36 2d 4c 37 35 2f 41 20 49 4e 54 56 49 45 57 45 5f 32 31 5f 32 30
Vendor 0001h
Product Type 000eh
Product Code 0060h
or
Code:
Message transmitted: Thu Feb 02 16:10:08.310 2012 Thread ID 0x00001c5c
ASA Connected message: Connection ID 0c81ed10 Multiple Service Packet MessageRouter
T: 0a 02 20 02 24 01 02 00 06 00 21 00 08 03 21 00 49 03 24 04 01 00 01 00 0d
00 41 73 73 6f 63 69 61 74 65 64 54 61 67 08 03 21 00 49 03 24 01 01 00 01
00 07 00 43 6f 6d 6d 65 6e 74
received: Thu Feb 02 16:10:08.330 2012
R: 8a 00 00 00 02 00 06 00 0e 00 88 00 00 00 04 00 00 00 88 00 00 00 01 00 00
00
This matches all the lines that start with T:
Code:
ffind /v /e"^T:" Debug.Log
Code:
ffind /v /e"^T:.+(\h+\s)*\n(\s+\h+)+" Debug.Log
-Scott