Find Command [F/F4]

Qedit 5.7 for HP-UX

Home Previous Next


Find Command [F/F4]

Finds the next line in the workfile that contains a string. Use Findup if you want to search for the previous line. Find always finds a single line that matches a string. Use the List command if you want to find many lines that match a string.

FIND [string] [linenum]

FIND [string range] [linenum]

(Q=no display)

(Default: string = recent; linenum = *+1)

Find defaults string to be "same as last string" and linenum to be "starting from the next line". This saves having to repeatedly type the string and linenum. Once you have defined your string and starting position, just enter "F" to find the next line.

Find does not start searching at the beginning of your file. Find will start searching for the string at the line after the current line, unless you specify a linenum to start the search. If you want to search from the beginning of your file, use Find string FIRST.

The F4 user key does the same function as Find with no parameters.

Examples

/find "exit" first     {find first line with "exit"}
    45     this command will cause an exit from the
                                  (28)^
/f                     {find next line with "exit"}
    90     after you exit from a module, the program
                 (11)^
/f                     {continue finding lines...}
   ...
/f                     {...until you reach end of file}
Warning: No Line         {prints error and rewinds}
Error: End of File
/f                     {next Find wraps around!}
Warning: Rewind to FIRST
    45     this command will cause an exit from the
                                  (28)^
/fq"$page"(1/5);m      {find next $page and modify it}
/fq;c""exit"           {find next string and change it}
/fq;c"""               {find next string and remove it}
/f "start"/"end" [     {find string range and set ZZ}
Lines 5/11 saved in ZZ

Notes

The Q option lets you find the line without printing it. Use FQ if you intend to Modify the line after you find it.

Find prints an error when the search reaches the LAST line without locating the string. Then, if you enter another Find without a line number, the search starts from the FIRST line in the file, after printing a warning.

To find/see all occurrences of a string in a file, use the List command.

When a string range is used and a corresponding block is found, the start and end line numbers are stored in the ZZ marker.


Home Previous Next