search <channel> ,<string>
Search the data on a system input channel for the occurrence of a string.
<channel>
A channel identifier.
<string>
The text to search for, a string expression.
-h
Treat comment lines (beginning with ’#’) as
bona fide input lines. The default is to ignore comment lines.
-r=<num>:<num>
Restrict the search on each input line to a range of columns.
-u
Treat upper and lower case characters as different. The default is to
treat them as equal.
-w
Treat <string>
as a wild pattern. This is the default behavior. Sometimes the search
string may contain characters which are normally considered wild, e.g.
* or #, so this switch should be negated in such cases by -no_w.
The search command may only be used on channels opened for reading, i.e. modes r and rw.
An empty <string> will result in no action.
If the search is successful, <channel> will be positioned so that the next read or search command will start at the line where the match was found. The system numeric found will then be set to 1.
If the search is unsuccessful, <channel> will be positioned at where it was before the command was executed. The system numeric found will then be set to 0.
Open a file for reading, and search for "close".
open chan1, -f=test.dat search chan1,'close' if (found) !Got it; else !Not there chan1.close
Commands: |
|
Identifiers: |
|
Structures: |