home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Don Maslin Archive
/
maslin_archive.zip
/
AARDVARK_Tape_Backups
/
maslin_c_d_3oct95
/
ddrive
/
sydex
/
sanyo
/
helpdex.td0
/
EDLIN.HDX
< prev
next >
Wrap
Text File
|
1990-02-15
|
19KB
|
521 lines
80/F0/07/F0/F0/F0/07
MS-DOS EDLIN Text Editor
Index
12
15 February 1990
SYNTAX Understanding the syntax. APPENDIX
KEYS Editing and function keys. APPENDIX
CREDITS References and trademarks. HELP
-----------------------------------------
EDLIN Running the MS-DOS editor.
Append Add lines from file to buffer.
Copy Copy range of lines.
Delete Delete range of lines.
Edit Edit line of text.
End Save to diskette and quit.
Insert Insert lines.
List List range of lines.
Move Move range of lines.
Page List range of lines.
Quit Quit w/o saving to diskette.
Replace Replace string w/new string.
Search Search for string.
Transfer Merge file from diskette.
Write Write lines to output file.
!DOCUMENT
!EDLIN
EDLIN: Running the MS-DOS editor.
The text editor, EDLIN, supplied with MS-DOS is a simple text editor which
can be used to:
1. create and save new ASCII text files,
2. update existing ASCII text files and save the updated
and original files,
3. copy, delete, display, edit, insert, and move lines,
and 4. search for, delete, and replace text strings within a
specified range of lines.
The text created or edited with EDLIN is divided into lines varying length.
The length of any line cannot exceed 253 characters. Line numbers are
displayed by EDLIN during the editing session but are not a part of the file
as it is saved.
SYNTAX:
EDLIN [/B] [filespec]
where the /B switch tells EDLIN to ignore CONTROL Z characters and
display the entire contents of the file.
Enter the EDLIN command conforming to the syntax above at the MS-DOS prompt.
When ready, EDLIN will display the message "End of input file" on the console
display device followed on the next line by the EDLIN prompt, the asterisk (*).
If the file specified does not exist it will be created and EDLIN will instead
display the message "New file" followed on the next line by the EDLIN prompt.
EXAMPLE:
EDLIN AUTOEXEC.BAT Runs EDLIN and loads the file AUTOEXEC.BAT.
Use the editing commands of EDLIN to add or modify the text of the file. To
quit EDLIN use the E (End) command to save the file to disk and quit, or the
Q (Quit) command to quit EDLIN without saving the file.
EDLIN commands consist of a letter, which may be entered either as upper or
lower case, preceeded and/or followed by one or more parameters. Any of the
commands of EDLIN may be aborted at any time by using the MS-DOS function key
<CONTROL C>. All of the MS-DOS editing and function keys are active in the
EDLIN environment (see KEYS in the index). When a syntax error has occured in
an EDLIN command EDLIN will display the message "Entry error" on the console
display device followed on the next line by EDLIN prompt.
The commands of EDLIN are summarized in Table 1 below.
--------------------------------
Command | Function
================================
|
<n> | Edit line n
A | Append lines
C | Copy lines
D | Delete lines
E | End session
I | Insert lines
L | List lines
M | Move lines
P | Page lines
Q | Quit session
R | Replace string
S | Search for string
T | Transfer file
W | Write lines
--------------------------------
Table 1. Commands of EDLIN.
The following list contains information generally applicable to the editing
commands of EDLIN.
1. The current line is the line with the asterisk following
the line number.
2. You can reference line numbers relative to the current
line by using a minus (-) od plus (+) sign with a number
to indicate lines before or after the current line, e.g.,
-5,+5L
which will list 5 lines before the current line, the
current line, and 5 lines after the current line.
3. The pound (#) character may be used in place of a number
to indicate the last line of the file, e.g.,
1,#L
displays on the console the file from the first line
through the last line of the file.
4. Multiple commands may be issued on one command line.
If you issue an Edit command to edit a single line using
a line number, a semicolon (;) must separate commands on
the line, e.g.,
25;-5,+5L
displays line 25 for editing, then displays lines 20
through 30 after line 25 has been edited. Otherwise,
one command may follow another without the use of the
semicolon. In the case of Search or Replace command
the string of text is ended by <CTRL>+<Z> instead of
<ENTER> if another command is to follow, e.g.,
Sapple^Z-5,+5L
(^Z is the CONTROL Z character) searches for the first
occurance of the string apple after the current line
and displays the line in which the string occurs, making
it the current line, and then displays 5 lines before
the new current line, the new current line, and 5 lines
after the new current line.
5. Commands can be typed with or without a space between
the line number and the command, e.g., 5D is the same
as 5 D.
6. A control character can be inserted into a string of
text by using the EDLIN quote character, CONTROL V,
before it. CONTROL V tells EDLIN to recognize the next
upper case letter typed as a control character. It is
possible to insert CONTROL V into the string of text by
typing following the CONTROL V character with V.
7. The CONTROL Z character is interpreted by EDLIN to be
the end of file character. If there are CONTROL Z
characters elsewhere in a file, use the /B switch to
tell EDLIN to ignore the CONTROL Z characters and
display the entire contents of the file.
For complete information about each command please return to the index and
select the desired command.
!APPEND
COMMAND: Append
PURPOSE: Read the specified number of lines from disk file to file being
edited in memory.
SYNTAX:
[n]A where n is the number of lines to be read.
EXAMPLE:
[100]A reads next 100 lines of file on disk.
The append command is only used if the file being editied is too large to fit
in available memory. EDLIN reads lines from the disk file into memory until
the available memory is 75% full. Use the write command to write the editied
lines back to disk before using the append command. The append command has no
effect if the available memory is already 75% full.
If the number of lines is not specified, the append command will cause lines to
be read from the disk file until the available memory is 75% full or the end of
file is reached. The message "End of input file" will be displayed when the
last line of the file has been read.
!COPY
COMMAND: Copy
PURPOSE: Copy a range of lines and insert at the specified position.
SYNTAX:
[line1],[line2],<line3>[,n]C
where line1 is the beginning line number of the range of lines to be
copied,
line2 is the ending line number of the range of lines to be
copied,
line3 is the position where the lines being copied are to be
inserted, and
n is the number of times the range of lines are to be
repeated in the copy.
If either line1 or line2 is omitted, the current line is assumed. If
both line1 and line2 are omitted only the current line is copied. If ,n
is omitted, the range of lines is copied once only. The range of lines
specified by line1 and line2 must not overlap the position line3 to which
the range of lines are to be copied. The lines of the file are renumbered
automatically after copy command is executed. The line at the position
specified by line3 becomes the current line.
EXAMPLE:
3,5,1C copies lines 3 through 5 and inserts the copy at line 1.
!DELETE
COMMAND: Delete
PURPOSE: Delete a range of lines.
SYNTAX:
[line1][,line2]D
where line1 is the beginning line number of the range of lines to be
deleted,
line2 is the ending line number of the range of lines to be
deleted,
If either line1 or ,line2 is omitted, the current line is assumed. If
both line1 and ,line2 are omitted, the current line is deleted. The
lines of the file are renumbered automatically after copy command is
executed. The line following the last deleted line becomes the current
line.
EXAMPLE:
3,5,D deletes lines 3 through 5.
4D deletes line 4.
!EDIT
COMMAND: Edit
PURPOSE: Display a line of text for editing.
SYNTAX:
[line] where line is the number of the line to be edited.
When the line number is enterd, EDLIN will display the line number
followed by the line of text. On the line below, EDLIN reprints the line
number and the line is ready for editing. The displayed line of text
serves as the template for editing. Use the function keys to copy all or
part of the text of the template and to insert or delete text as desired.
When the return key is pressed any text beyond the cursor position will be
deleted.
To edit the current line, enter the period in place of the line number.
To edit the line following the current line or next line omit the line
number and press the ENTER key.
Use the special editing keys of MS-DOS to edit the line. Refer to the
index for information regarding MS-DOS editing and function keys.
!END
COMMAND: End
PURPOSE: End the editing session by saving the editied file and return to
MS-DOS.
SYNTAX:
E
EXAMPLE:
E ends the editing session, saves the edited file, and quits EDLIN.
If the file existed on disk when the session was started, a backup file,
filename.BAK, will be created. If the disk does not have enough space to
save the edited file, the part or all of the edited file will be lost.
!INSERT
COMMAND: Insert
PURPOSE: Insert a new line at the position specified.
SYNTAX:
[line]I where line is the position at which the line is to be inserted.
If line is omitted, the current line is assumed. The line following the
last inserted line becomes the current line.
!LIST
COMMAND: List
PURPOSE: Display a range of lines.
SYNTAX:
[line1][,line2]L
where line1 is the beginning line number of the range of lines to be
displayed,
line2 is the ending line number of the range of lines to be
displayed,
If line1 is omitted, the range of lines begins 11 lines before the current
line. If ,line2 is omitted, the range will be 23 lines beginning with line1.
If both line1 and ,line2 are omitted, the range is 23 lines beginning 11
lines before the current line. The List command differed from the Page
command in that the List command has no effect on the number of the current
line.
EXAMPLE:
40L displays 23 lines beginning with line 40.
!MOVE
COMMAND: Move
PURPOSE: Move a range of lines and insert at a specified position.
SYNTAX:
[line1],[line2],<line3>M
where line1 is the beginning line number of the range of lines to be
moved,
line2 is the ending line number of the range of lines to be
moved,
line3 is the position where the lines being moved are to be
inserted, and
If either line1 or line2 is omitted, the current line is assumed. If both
line1 and ,line2 are omitted, only the current line is moved. The range
of lines specified by line1 and line2 must not overlap the position, line3,
to which the range of lines are to be moved. The lines of the file are
renumbered automatically after move command is executed. The line at the
position specified by line3 becomes the current line.
EXAMPLE:
3,5,1M moves lines 3 through 5 and inserts them at line 1.
!PAGE
COMMAND: Page
PURPOSE: Display a range of lines.
SYNTAX:
[line1][,line2]P
where line1 is the beginning line number of the range of lines to be
displayed, and
line2 is the ending line number of the range of lines to be
displayed.
If line1 is omitted, the range of lines begins with the line following the
current line. If ,line2 is omitted, the range will be 23 lines beginning
with line1. If both line1 and ,line2 are omitted, the range is 23 lines
beginning with the line following the current line. The Page command differs
from the List command in that with the Page command the last line displayed
becomes the current line.
EXAMPLE:
P displays 23 lines beginning with the line following the current
line.
!QUIT
COMMAND: Quit
PURPOSE: Quit the editing session without saving the edited file and return
to MS-DOS.
SYNTAX:
Q
EXAMPLE:
Q quits the editing session and returns to MS-DOS without saving the
edited file.
If the file existed on disk when the session was started, the same file will
exist on the disk upon quitting EDLIN.
!REPLACE
COMMAND: Replace
PURPOSE: Search for a specified string of text in a specified range of lines
and replace each occurance with a new string of text.
SYNTAX:
[line1][,line2][?]R<string1><CONTROL-Z><string2>
where line1 is the beginning line number of the range of lines in which
the string of text is to be replaced,
line2 is the ending line number of the range of lines in which the
the string of text is to be replaced,
? causes the line in which string1 occurs to be displayed with the
occurance of string1 replaced by string2 and the user to be
prompted with the O.K.? prompt for a Y(es) or N(o) response
to replace or not to replace string1 with string2 at that
occurance,
string1 is the string of text to be searched for and replaced,
CONTROL-Z is the charcater generated by pressing and holding the CTRL
key while the Z key is pressed, and
string2 is the string of text with which the occurance of string1
is to be replaced by.
If either line1 or line2 is omitted, the current line is assumed. If both
line1 and ,line2 are omitted, only the current line is searched. If string1
occurs more than once in a line, each occurance of string1 will be replaced
by string2. Response to the O.K.? prompt by pressing a key other than the
Y key will cause the occurance of the string of text to be left unchanged.
If the specified string of text is not found, the message "Not found" will
be displayed.
EXAMPLE:
3,5Rapple<CONTROL-Z>orange
searches lines 3, 4, and 5 for the string apple and replaces apple
with orange at each occurance of the string apple.
!SEARCH
COMMAND: Search
PURPOSE: Search for a specified string of text in a specified range of lines.
SYNTAX:
[line1][,line2][?]S<string>
where line1 is the beginning line number of the range of lines in which
the string of text is to be searched for,
line2 is the ending line number of the range of lines in which the
the string of text is to be searched for,
? causes the line in which string1 occurs to be displayed and the
user to be prompted with the O.K.? prompt for a Y(es) or N(o)
response to terminate the search and make the displayed line
the current line, and
string is the string of text to be searched for.
If either line1 is omitted, the line after the current line is assumed.
If line2 is ommited the last line of the file is assumed. If the string
is omitted the last string is assumed. If the last string is nul the search
will be terminated immediately. If the ? option is not used, the first line
in which the specified string of text occurs will be displayed, the search
will be terminated, and the displayed line will become the current line.
Response to the O.K.? prompt by pressing a key other than the Y key will
cause the occurance of the string of text to be left unchanged. If the
specified string of text is not found, the message "Not found" will be
displayed.
EXAMPLE:
3,5Sapple
searches lines 3, 4, and 5 for the string apple, displays the
first line in which the string apple appears, and makes the
displayed line the current line.
!TRANSFER
COMMAND: Transfer
PURPOSE: Merge a specified filefrom disk into the file currently being edited.
SYNTAX:
[line]T<filespec>
where line is the number of the line at which position the contents of
the specified file is to be inserted, and
filespec specifies the file to be merged.
If line is omitted, the current line is assumed. The previous line at
position line and lines following are renumbered to follow the lines of
the merged file.
EXAMPLE:
5TPEAR.TXT inserts the contents of the file PEAR.TXT at line 5 of the
file currently bing edited.
!WRITE
COMMAND: Write
PURPOSE: Write a specified number of lines, beginning with line 1, from the
file being edited in memory to the disk file.
SYNTAX:
[n]W where n is the number of lines to be written to the disk file.
The number of lines written to the disk file begins with line 1. If n is
omitted, lines will be written until available memory is 75% full and no
action will be taken if available memory is less than 75% full.
EXAMPLE:
25W writes the first 25 lines of the file currently being edited to the
disk file.