I have a file (test.log) that contains the string: TOTAL_MEMBERS in various places. I need to get a listing of the line that is always two lines above this string, but my version of grep apparently doesn't support the -C flag. Is there a way to get the information that I need?
Example of file data:
...
14:47:27.400: VALUE="10"
14:47:27.400: TYPE="STRING"
14:47:27.400: NAME="TOTAL_MEMBERS"
...
14:47:27.572: VALUE="23"
14:47:27.572: TYPE="STRING"
14:47:27.572: NAME="TOTAL_MEMBERS"
...
This should return:
14:47:27.400: VALUE="10"
14:47:27.572: VALUE="23"
Any help is appreciated.
Coley
Example of file data:
...
14:47:27.400: VALUE="10"
14:47:27.400: TYPE="STRING"
14:47:27.400: NAME="TOTAL_MEMBERS"
...
14:47:27.572: VALUE="23"
14:47:27.572: TYPE="STRING"
14:47:27.572: NAME="TOTAL_MEMBERS"
...
This should return:
14:47:27.400: VALUE="10"
14:47:27.572: VALUE="23"
Any help is appreciated.
Coley