EDIT is a line oriented text editor that can be used to process files sequentially under the control of editing
commands. EDIT moves through the input, or source file, line by line making any changes and passing the result to
the output, or destination file.
The argument FROM represents the source file that you want to edit. This must be a file that
The TO argument is the name of the destination file. This is the file to which EDIT
sends the output including any editing changes. If you omit the TO argument, EDIT
uses a temporary file and, when editing is complete, copies the temporary file to the original file, overwriting it.
The WITH argument allows you to specify a command file from which to get EDIT commands.
Ordinarily, EDIT functions interactively, reading commands that you type from the keyboard. You may put EDIT
commands in a file instead and have them executed automatically using the WITH argument to
specify the command file.
The VER argument gives the name of the file to which EDIT will send error messages and
line verifications. If you omit the VER argument EDIT will print its messages on the screen.
EDIT has the capability to move backward in the source file a limited number of lines. This is possible because
EDIT doesn't write the lines to the destination file immediately, but instead holds them in an output buffer. The
PREVIOUS argument specifies the number of lines that EDIT can move backwards in the
The WIDTH argument sets the maximum line length that EDIT can handle. Together the
PREVIOUS and WIDTH arguments determine the size of the buffer
that EDIT will use (buffer size = PREVIOUS * WIDTH).
Unless you specify otherwise, PREVIOUS is set to 40 and WIDTH
COMMAND QUICK REFERENCE
Here's a complete list of EDIT commands.
The list uses the following abbreviations:
||A string with delimiters (such as /any string/).
||Line number in source file; a period (.) refers to the current
line in the source file, an asterisk (*) refers to the last line.
||Switch (+ is on and - is off).
||A string or a qualified string with delimiters. There are five
qualifiers: B (beginning), E (ending), L (last), P (precisely),
and U (uppercase). For instance the qualified string "B/any
string/" matches "any string" if it occurs at the beginning of a
line. The qualified string U/x/ will match either upper- or
||Move to line n.
||Move to highest line in buffer.
||Move to lowest line in buffer.
||Find string qs.
||Find string qs moving backward through source file.
||Find string qs and delete any intervening lines.
Character Positioning Commands
||Move character pointer left.
||Move character pointer right.
||Delete character at pointer.
||Lower case character at pointer.
||Upper case character at pointer.
||Turn character at pointer to space.
||Position character pointer after qs.
||Position character pointer before qs.
||Reset character pointer to start of line.
Current Line Commands
|A qs t
||Put string t after qs.
|AP qs t
||Put string t after qs, position character pointer after t.
|B qs t
||Put string t before qs.
|BP qs t
||Put string t before qs, position character pointer after qs.
||Concatenate current line, string t, and next line.
||Delete line number n; if a second number is given, delete from n1
to n2 inclusive; if no number is given, delete the current line.
||Delete from current line to line containing qs.
||Delete from after qs to end of line.
||Delete from before qs to end of line.
||Delete from start of line to after qs.
||Delete from start of line to before qs.
|E qs t
||Exchange string qs with string t.
|EP qs t
||Exchange string qs with string t and position character pointer after t.
||Insert material typed at keyboard before line n (type Z to terminate keyboard input).
||Insert material from file t before the current line.
||Replace line n with material typed at keyboard (type Z to
terminate keyboard input); if a second line number is given,
replace lines from n1 to n2 with new material.
|R n t
||Replace line n with material from file t; if a second line number
is given, replace lines from n1 to n2 with file.
||Split line after qs.
||Split line before qs.
|GA qs t
||For each qs found as file is processed, place t after qs.
|GB qs t
||For each qs found as file is processed, place t before qs.
|GE qs t
||For each qs found as file is processed, replace qs with t.
||Cancel global n (cancel all if n omitted).
||Disable global n (disable all if n omitted).
||Enable global n (enable all if n omitted).
||Display info on globals used.
Text Verification Commands
||Verify current line.
||Verify with character indicators.
||Type to end of file.
||Type n lines.
||Type n lines with line numbers.
||Type until buffer changes.
||Move to top of buffer then type lines to end of buffer.
||Set verification on or off.
||Take source from file t.
||Revert to original source file.
||Place output lines in file t.
||Revert to original destination file.
||Close file t.
||Repeat previous A, B, or E command.
||Set line number to n.
||Take commands from file t.
||Set halt at line n. If n is * then halt and unset H.
||Rewind source file.
||Exit from command level; windup if at level 1.
||Quit without saving changes.
||Set or unset trailing space removal.
||Windup (exit saving changes).
||Set input terminator to string t.
3.OS4:> EDIT FROM program1 TO program1-new WITH my-edit-commands
starts EDIT with program1 as the source file and program1-new as the destination file. The EDIT commands in the file
my-edit-commands would be executed automatically as if they had been typed at the keyboard.
3.OS4:> EDIT FROM program1 PREVIOUS 50 WIDTH 240 VER ver-file
starts EDIT with program1 as the source file. Any changes made with EDIT will be written back to this same file since the TO
argument is omitted. The EDIT buffer is set up so that you can move back 50 previous lines. The line width is limited to 240
characters. All verification and error messages from EDIT will be sent to the file ver-file.
See Also: ED, MeMacs, Notepad
Return to Commands Selection