System information
ED also provides a single command that combines the F and I commands to perform simple
string substitutions. The command takes the following form:
nSs1^Zs2<cr>
or
nSs1^Zs2^Z
and has exactly the same effect as applying the following command string a total of n times:
Fs1^Z-kDIs2<cr>
or
Fs1^Z-kDIs2^Z
where k is the length of the string. ED searches the memory buffer starting at the current position
of CP and successively substitutes the second string for the first string untill the end of buffer, or
until the substitution has been performed n times.
As a convenience, a command similar to F is provided by ED that automatically appends and
writes lines as the search proceeds. The form is
nNs<cr>
or
nNs^Z
which searches the entire source file for the nth occurrence of the strings (you should recall that F
fails if the string cannot be found in the current buffer). The operation of the N command is
precisely the same as F except in the case that the string cannot be found within the current
memory buffer. In this case, the entire memory content is written (that is, an automatic #W is
issued). Input lines are then read until the buffer is at least half full, or the entire source file is
exhausted. The search continues in this manner until the string has been found n times, or until
the source file has been completely transferred to the temporary file.
2.1 Introduction to ED CP/M Operating System Manual
2-14