Option 'A' --> Output Context Lines After Match. Normally QTGrep
only outputs the line matched. However, sometimes it is desirable to
view the matched lines within the context of the lines before and after
the matched line. This option turns on and off or sets the number of
lines output after the matched line. The format of this option is:
-A+ --> turns on outputting context lines after the matched
line. Uses the value for the
number of lines as set in the configuration file.
-A- --> turns off outputting of context lines after the
matched line.
-Ann
or
-A(nn)
or
-A nn
--> this form turns on outputting context
lines after the match line and sets the number of
lines output to 'nn'
Note that when context lines are output before and/or after matched
lines, the context lines are distingished from the matched lines by
prefixing each context line with a single hyphen, '-', and prefixing
each match line with a single colon, ':'. Thus the output for context
lines following a match line is:
:This line matched an input expression
-This line is the first context line following
-This line is the second context line following
Note that if expression numbers are also output, the expression
number is output as a field of asterics, '*', for context lines.
Note that if line/record numbers are also output, the record number of
the context line is output also. As mentioned above, the record number
specifier, 'R', is followed by a hyphen, '-', for context lines
and by a colon, ':', for match lines.
Thus if record number are output, the output would resemble:
345: This line matched an input expression
346- This line is the first context line
following
347- This line is the second context line
following
Note: A numeric value set with this option over-rides any numeric value
set with the 'O' option.
See Also the 'O' and 'Y' options
This is a local option and may be turned on or off for separate files
as desired.
The corresponding long option is: --after-context=(on|off)
If context lines are turned on with the long option:
--after-context=on
Then the number of context lines specified in the configuration
file is utilized. If no value was specified in the configuration file,
then the default value of 5 is utilized.
Incompatible Options Are:
| Z |
File Preview |
| c |
Count of Matches Only |
| r |
Match Replacement |
| y |
Ignore Records |
| z |
Simulate Match Replacement |