next previous up contents index
Next: RETURN Previous: REKEY Up: The Commands in Detail


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 two commands

give the following results:


next previous up contents index
Next: RETURN Previous: REKEY Up: The Commands in Detail