FIND - Find a Character String
Syntax
FIND Alias - FF |
search-string (Perform a normal FIND) [ start-column [ end-column ] ] [ FIRST | LAST | NEXT | PREV | ALL ] [ PREFIX | SUFFIX | WORD | CHAR ] [ C ] [ Q ] [ T ] [ LEFT | RIGHT ] [ line-control-range ] [ color-selection-criteria ] [ color-change-request ] [ MX | DX ] [ TOP ] |
Operands
Operand descriptions are for the FIND command.
search-string |
The search string that identifies the lines to be found |
||
start-column |
Left column of a range (with end-column) within which the search-string value must be found. If no end-column operand, then the search-string operand must be found starting in start-col. |
||
end-column |
Right column of a range (with start-column) within which the search-string value must be found. |
||
FIRST |
Starts at the top of the data and searches ahead to find the first occurrence of search-string. |
||
LAST |
Starts at the bottom of the data and searches backward to find the last occurrence of search-string. |
||
NEXT |
Starts at the first position after the current cursor location and searches ahead to find the next occurrence of search-string. NEXT is the default. |
||
PREV |
Starts at the current cursor location and searches backward to find the previous occurrence of search-string. |
||
|
|
||
ALL |
Starts at the top of the data and searches ahead to find all occurrences of search-string. |
||
LEFT |
LEFT causes the search-string to be found at most once in any given line. Where the search-string occurs more than once in the same line, only the left-most occurrence of search-string is found, and any other instances on that same line are ignored. |
||
RIGHT |
RIGHT causes the search-string to be found at most once in any given line. Where the search-string occurs more than once in the same line, only the right-most occurrence of search-string is found, and any other instances on that same line are ignored. |
||
PREFIX |
Locates search-string at the beginning of a word. |
||
WORD |
Locates search-string when it is delimited on both sides by blanks or other non-Word characters. |
||
CHAR |
Locates search-string regardless of what precedes or follows it. |
||
SUFFIX |
Locates search-string at the end of a word. |
||
line-control-range |
The range of lines which are to be processed by the command. The full syntax and allowable operands which make up a line control range are discussed in "Line Control Range Specification". See also the Line Range / Pending Copy Conflict discussion below. |
||
color-selection-criteria |
A request for selection based on the highlight color of the search-string. The full syntax and allowable operands which make up a color-selection-criteria are discussed in "Color Selection Criteria Specification". |
||
color-change-request |
A request for highlighting of the found string. The full syntax and allowable operands for the color-change-request are discussed in "Color Change Request Specification". |
||
MX |
MX requests that all lines which DO contain search-string be excluded from the display following command processing. MX = Make Excluded. |
||
DX |
DX requests that lines which DO contain search-string, which, if excluded, would normally be made visible, be left in their excluded status. DX = Don't change Excluded status |
||
TOP |
|
Abbreviations and Aliases
FIND can also be spelled as F
PREFIX can also be spelled as PRE or PFX
SUFFIX can also be spelled as SUF or SFX
WORDS can also be spelled as WORD
CHARS can also be spelled as CHAR
Description
Difference between FF and FIND
The FF alias for the FIND command is identical to FIND with the following distinction:
- FF will honor a pending CC/CC block as the line range to be searched.
- FIND will ignore the pending CC/CC block so that you can use FIND to search for a position where you might want to place an A or B command.
Normal Usage
You can use the FIND command to locate line(s) within the file which contain a specified string.
To find the next occurrence of the letters ELSE without specifying any other qualifications:
On the Command line, type:
FIND ELSE
Press Enter. Since no other qualifications were specified, the letters ELSE can be:
- Uppercase or a mixture of uppercase and lowercase (assuming that CASE T is in effect)
- At the beginning of a word (prefix), the end of a word (suffix), or the entire word (word).
- In either an excluded or a non excluded line.
- Anywhere within the current boundaries.
To find the next occurrence of the letters ELSE, but only if the letters are uppercase:
On the Command line, type:
FIND C'ELSE'
Press Enter. This type of search is called a character string search (note the C that precedes the search string) because it finds the next occurrence of the letters ELSE only if the letters are in uppercase. However, since no other qualifications were specified, the letters can be found anywhere in the file, as outlined in the preceding list.
For more information, including other types of search strings, see Finding and Changing Data and Specifying a Picture or Format String.
Note: When the FIND search operand is a Regular Expression (a string with an R type code) and reverse-order searching is done with PREV or LAST, only the left-most occurrence on any given line is found. That is, the command
FIND R'ABC' PREV
is treated as if it were specified as
FIND LEFT R'ABC' PREV
and
FIND R'ABC' LAST
is treated as if it were specified as
FIND LEFT R'ABC' LAST
Note: FIND cannot be used to find zero-length blank lines based on a string. See NFIND for an example of how to do this.