Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- EDLIN - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

    Search Text command

    Purpose:  Searches a specified range of lines in order to locate a spe-
              cified string.

    Format:   [line][,line][?]S[string]

    Remarks:  The first line to contain the specified string is displayed
              and the search ends (unless you use the ? parameter). The
              first line found that contains the specified string becomes
              the current line.

                 Note:
                 The Search command always searches for the exact same char-
                 acter in text. That is, it searches for UPPERCASE if you
                 enter UPPERCASE, and lowercase if you enter lowercase.

              You should specify the optional parameter ? if you would like
              a prompt (O.K.?) after each display of a line containing the
              specified string.

              If you do not enter a string, the S command uses the last
              search string entered on a Replace or Search command. If the
              specified string is not found, the search ends, and the mes-
              sage Not found is displayed. The current line remains unchan-
              ged. If you enter Y or press the Enter key, the line that mat-
              ches the specified string becomes the current line and the
              search ends. Enter any other character to continue the search
              until another string is found, or until all lines within the
              range are searched. Once all the lines within the range are
              searched, the Not found message is displayed.

              The system provides default values if you omit the first, se-
              cond, or both line parameters. If you omit the first line pa-
              rameter, the system defaults to the line following the current
              line. If you omit the second line parameter, the system de-
              faults to the last line in memory. If you omit both line para-
              meters, the system searches from the line following the cur-
              rent line to the last line in memory.

              Notes:

              1.  The string begins with the character in the position imme-
                  diately following the S and continues until you end the
                  string by pressing the Enter key.

              2.  If you wish to place more than one command on a line con-
                  taining a Search Text command, the Search Text command
                  should end in a Ctrl-Z (F6), and the next command should
                  begin in the following character position.

Example:      Assume that you want to edit the following file. Line 7 is the
              current line.

              1: This is a sample file
              2: used to demonstrate
              3: the Search Text command.
              4: This includes the
              5: optional parameter ?
              6: and required string
              7:*parameter.

              If you want to search for the first occurrence of and in the
              file, enter:

              1,7 Sand
                 or
              1, Sand
                 or
              1Sand

              The result is:
                3: the Search Text command.
              *

              The and is part of the word command. Notice that line 3
              becomes the current line in the file.

              Perhaps this is not the and you were looking for. To continue
              the search, simply enter the letter S and press Enter. The
              search continues with the line following the current line (the
              line just found).

              The screen looks like this:

              1,7 Sand
                3: the Search Text command.
              S
                6: and required string
              *

              Line 6 now becomes the current line in the file.

              You can also search for strings by requesting a prompt (by
              means of the ? parameter) after each display of a matching
              line. In this case, the screen looks like this:

              1,7 Sand
                3: the Search Text command.
              O.K.? N
                6: and required string
              O.K.? Y
              *

See Also: line string Common

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson