Commodore PC Ms-Dos 3.2 User's Manual page 235

Table of Contents

Advertisement

Edlin Commands 163
n
n
n
n
n
n
n
Replace
{***)
Purpose:
Replaces all occurrences of a string of text in a range with
a different string of text.
Syntax:
[line][,line][?]rtextl control-z text2
Comments:
The first and second line options specify the range of lines that
the R (replace) command uses. Each time edlin finds textl, it
replaces it with text2, displaying each line that changes. If a line
contains two or more replacements, it is displayed once for each
change. When edlin has made all the changes, the R command
ends and the asterisk prompt reappears.
If you want to replace one string of text with another, you must
separate the two with a control-z. You can end the second string
by pressing the return key.
If you do not specify textl, the R command assumes the old (the
previous) value. If this is the first replacement that you have made
during the current editing session, and if you do not specify textl,
the command ends. If you do not specify text2, you must end
textl by pressing the return key.
If you omit the first line option, edlin uses the line after the
current line, by default. The default for the second line option
is #. Remember that # refers to the line after the last line
of the file.
If you end textl with a control-z and do not specify text2, edlin
assumes you want blank spaces for text2. For example, suppose
you want to delete all occurrences of the word clients from your
file. To do this you could simply type the following command,
then press control-z and return:
re 1ients
The next command replaces clients with the previous text2:
re 1ient5
The following command makes the previous textl become the
previous text2:
(R)eplace
Deleting all
occurrences of a
word from a file
Replacing a
string of text
throughout a file

Advertisement

Table of Contents
loading

Table of Contents