Previous Next Chapter

Editing the Current Line

The following commands add new material or replace material on the current line.

Insert <string2> after <string1>

A <string1> <string2>

Insert <string2> after the first occurrence of <string1>.

Insert <string2> before <string1>

B <string2> <string1>

Insert <string2> before the first occurrence of <string1>.

Exchange <string2> for <string1>

E <string2> <string1>

Replaces the first occurrence of <string1> with <string2>.

Inserting and Deleting Lines

The following commands insert new material (non-original lines) and delete lines from the source file. You can also insert complete files into the source file.

Insert one or more lines

| [<n>]

If given alone or with a line number, inserts text before the current line.

If given with an asterisk, the text is inserted at the end of the file.

Indicate the end of the insertion by pressing Return, Z, and Return.

Delete one or more lines

D [<n>]

Deletes the current line if entered with no arguments. Deletes a specific line if entered with a line number. Deletes a set of lines if entered with a range of line numbers; do not use punctuation between the numbers. Deletes everything from the current line through the end of the source file of entered with a period and an asterisk as arguments.

Delete all lines until the specified string is found

D,F<string>

Deletes successive lines from the source file until the line containing the matching string is found. If no argument is specified, it deletes all lines until it finds the last string specified.

Delete existing lines and replace with new text

R [<n>]

Lets you delete line and then insert new ones. Entering a line number following R indicates a specific line to replace.

Change the terminator

Z <string>

Tells EDIT that it has reached the end of any new text that is being inserted. Entering a string after Z changes it from the default.

Show current information about EDIT

S,H,D

Displays saved information values, such as the last string searched for, the last command entered, and the input terminator.

Turn trailing spaces on/off

T,R,+|-

Preserves any blanks that fall at the end of lines.

Editing Line Windows

You can define subsections of the line, called line windows, on which EDIT executes all subsequent commands. In the descriptions of EDIT qualifiers, the beginning of the line always indicates the beginning of the line window.

Whenever EDIT verifies a current line, it indicates the position of the line window by displaying a > character directly beneath the line. EDIT omits the pointer if the line window begins at the start of the line.

The following commands control the position of the character pointer:

>

Moves the pointer one character to the right.

<

Moves the pointer one character to the left.

PR

Resets the pointer to the start of the line.

PA <string>

Moves the pointer to the first character after the specified string.

<string>

Moves the pointer to the first character before the specified string.

The following commands change the character at the current pointer, then move the pointer.

$

Makes the character at the pointer lower case, then moves the pointer one character to the right.

%

Makes the character at the pointer upper case, then moves the pointer one character to the right.

_

The _ (underscore) command deletes the character at the pointer, turning it into a space, then moves the pointer one character to the right.

#

Deletes the character at the pointer, then moves the rest of the line one character to the left. To delete several characters, specify a number before the #. For example, 5# deletes the next five characters in the window.

A combination of these commands can be used to edit a line character by character.

The following commands insert and exchange text on the current line, similar to the A, B, and E commands; however, the character pointer is moved on completion.

Insert <string2> after <string1>

A,P <string1> <string2>

Inserts <string2> after the first occurrence of <string1>. The pointer is then positioned after <string2>.

Insert <string2> before <string1>

B,P <string1> <string2>

Inserts <string2> before the first occurrence of <string1>. The pointer is then positioned after <string2>.

Exchange <string1> with <string2>

E,P, <string1> <string2>

Replaces the first occurrence of <string1> with <string2>. The pointer is then positioned after <string2>.

Delete Till After

D,T,A <string>

Deletes all text from the beginning of the line or the character pointer to the end of the specified string.

Delete Till Before

D,T,B <string>

Deletes all text from the beginning of the line or the character pointer; stops before the specified string.

Delete From After

D,F,A <string>

Deletes all text starting after a specified string to the end of the line.

Delete From Before

D,F,B <string>

Deletes all text starting with the specified string to the end of the line.

Top Previous Next Chapter