The FIND primary
command locates one or more occurrences of a search string.
Syntax
.-.ZFIRST--.ZLAST-. .-NEXT--.
>>-+-FIND-+--string--+-----------------+--+-------+------------->
'-F----' '-labela--labelb--' +-ALL---+
+-FIRST-+
+-LAST--+
'-PREV--'
.-CHARS--.
>--+--------+--+----+--+---------------------+-----------------><
+-PREFIX-+ +-X--+ +-start_col-----------+
+-SUFFIX-+ '-NX-' '-left_col--right_col-'
'-WORD---'
- string
- The search string you want to find. See Finding, seeking, changing, and excluding data.
- labela, labelb
- Labels identifying the start and end of the group of lines which
FIND is to search.
For more information about using labels to
identify a group of lines, see Labels and line ranges.
- NEXT
- Starts at the first position after the current cursor location
and searches ahead to find the next occurrence of string.
- ALL
- Starts at the top of the data and searches ahead to find all occurrences
of string.
- FIRST
- Starts at the top of the data and searches ahead to find the first
occurrence of string.
- LAST
- Starts at the bottom of the data and searches backward to find
the last occurrence of string.
- PREV
- Starts at the current cursor location and searches backward to
find the previous occurrence of string.
- CHARS
- Locates string anywhere the characters match.
- PREFIX
- Locates string at the beginning of a word.
- SUFFIX
- Locates string at the end of a word.
- WORD
- String is delimited on both sides by blanks or other non-alphanumeric
characters.
- X
- Scans only lines that are excluded from the display.
- NX
- Scans only lines that are not excluded from the display.
- start_col
- The first column to be included in the range of columns to be
searched. When you specify only one column, the editor finds the string
only if the string starts in the specified column.
- left_col
- Number of the first column the FIND command is to search.
- right_col
- Number of the last column the FIND command is to search.
Description
You
can use the FIND command with the EXCLUDE and CHANGE commands to find
a search string, change it, and exclude the line that contains the
string from the panel.
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
- 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 data set
or member, as outlined in the preceding list.
For more information, including
other types of search strings, see Finding, seeking, changing, and excluding data.
Examples
The example shown here finds the
first occurrence in the data set of the letters
ELSE.
However, the letters must occur on or between lines labeled .E and
.S and they must be the first four letters of a word:
FIND ELSE .E .S FIRST PREFIX
The
example shown here finds the last occurrence in the data set of the
letters
ELSE. However, the letters must occur on
or between lines labeled .E and .S; they must be the last four letters
of a word; and they must be found in an excluded line.
FIND ELSE .E .S LAST SUFFIX X
The
example shown here finds the first occurrence of the letters
ELSE that
immediately precedes the cursor position. However, the cursor must
not be positioned ahead of the lines labeled .E and .S. The letters
must occur on or between lines labeled .E and .S; they must be standalone
characters (not part of any other word); they must be found in a non-excluded
line; and they must exist within columns 1 and 5:
FIND ELSE .E .S PREV WORD NX 1 5