REPLACE col1 [col2] /string/ [n] R
Related command: CHANGE, CONCAT
With the command REPLACE you insert a character string in the line(s) specified. Contrasting to CHANGE, the content of the character string to be replaced is irrelevant.
REPLACE substitutes a character string in the record of the current line or in n records starting at the current line.
You always have to specify the column, at which the character string has to be inserted. You manipulate the behaviour of REPLACE by specifying or omitting the second column as follows:
If you do not specify the end column, as many characters are inserted as the string is long. Characters that might be behind the inserted characters remain untouched.
If you specify the begin and the end column, REPLACE behaves as CHANGE with arbitrary content of the columns to be replaced. In other words, the character string that is limited by initial and final column is cut out of the line and the new string is inserted; the original content beyond the final column is moved to the left or to the right, so that it is adjacent to the new characters.
Examples: The current line contains the text
The weather has been fine.
The two commands
replace 13/had/
r21 25/foggy
give the following results:
The weather had been fine.
The weather had been foggy.