The replace command: replacing lines of text – HP NonStop G-Series User Manual
Page 48
![background image](/manuals/397048/48/background.png)
The REPLACE Command: Replacing Lines of Text
Revising Text in Your File
058061 Tandem Computers Incorporated
3–5
The REPLACE
Command: Replacing
Lines of Text
The REPLACE command allows you to replace the text in a specified
location of your file. You can:
Replace a single line
Replace consecutive lines
Suppose your current file contains these lines:
1 Simple Simon
2 She made some tarts
3 All on a summer's day;
4 Says Simple Simon to the pieman:
5 "Pray let me taste your ware."
6 Said the pieman to Simple Simon:
7 "Show me first your penny."
8 Says Simple Simon to the pieman:
9 "Indeed I have not any."
You can replace a single line of text using REPLACE. To replace line 1:
*REPLACE 1
1 Simple Simon
1 The Queen of Hearts
*
EDIT displays existing text on line 1, then prompts for new text with that
line number. Type in the new text.
You can also replace consecutive lines of text by providing EDIT with a
range of lines. EDIT displays the first line in the range and prompts you
with that line number. Type in the new text and press
RETURN
; EDIT will
prompt you with the next line. Continue until you have replaced all the
lines in the range.