| |
As you begin to use the Hessling Editor you will discover differences from its
CMS counterpart. Some of these are due to the UNIX operating system and some are
just design and implementation differences. The list resulted from trial and error
and should not be considered complete.
Invoking THE
There are two ways to start THE:
the filename
or
x filename
If the file exists in your current directory, THE will open it. If the file
does not exist, THE will create it. You may also use filename with a preceding
path, if appropriate. For example, from your home directory you may enter:
| the myfile |
to edit or create the file myfile |
| the ~/myspsdir/test2 |
to edit or create a file in your sub- directory, myspsdir,
called test2. |
Tools for inserting text
Insert and delete
The Ins insert key, if available and defined, toggles a variation
of insert mode. To insert text in the same line, have Ins on, position
the cursor and type. The following code creates an insert key if there is
no ins key available:
define c-v set insertmode toggle
If no Ins is defined, character insert may not be possible. If
Ins is not defined, define this key when needed.
Character delete can be accomplished with the UNIX Ctrl-h backspace.
Move cursor to de sired location and backspace. Another character delete,
which may work a little differently, can be defined:
define c-d sos delchar
This creates a character delete at Ctrl-d. The difference between these
delete keys is the Crtrl-h backspace deletes the character to the left of
the cursor, the following text shifts left, and the cursor moves left. The
Ctrl-d key (created above) deletes the character under the cursor, the following
text shifts left and the cursor stays put. The latter will be more familiar
to CMS users.
Append
The cappend command appends text to one line. To append text to several
lines, try:
set zone 1 *
append 8 /* this is a comment */
This appends the comment to 8 lines (substitute some number for 8) to
the end of the current line and those following. Note 'append' is a macro.
To append to the far right, leaving space after your data, try:
set zone 60 *
c//xyz/ *
zone 1 *
This starts the new data in column 60 (beyond the existing data?), thus
effectively creating fixed record lengths for your file. Reset the zone
if you plan to continue editing. Note: Use this to fill in variable length
records in data files which may caus e premature line ejects in statistical
package data input. There is no 'set lrecl' command.
Power input
Power input is a combination of "margins" and "wordwrap". You may use
the "x*" prefix command to hide lines so that wordwrap does not write over
them. Consider the following:
set margins 1 50
set wordwrap on
Any text typed in the body of the file goes in making it's own line breaks.
Lines break at spaces between words. No line will be longer than the 50
characters indicated in the margin command. Be careful of writing over text
following the input area, if yo u have not hidden it.
Examples of removing text
Change and the arbitrary character
Assume you have 15 columns of data, then enter the following in THE:
set zone 5 10
set arbchar on $ ?
These two commands should mark a strip consisting of columns 5 thru 10
for processing and initialize two wild characters to use in searches. Note
the operation of certain change commands:
| c/$// * * |
Does not function ($ not implemented yet) |
| c/?// * * |
Removes all data from column 5 on. |
| c/?// * 5 |
Removes data in columns 5 thru 9, closes space |
| c/?/ / * * |
Removes data in columns 5 thru 10, leaves space |
Notice the $, called the multiple arbitrary character, is not implemented
yet. The first asterisk is how many lines to process, the second is how
many columns to process. Apparently when a column is removed, as in example
two, a subsequent column moves in to the place, so all subsequent columns
get removed iteratively. The third and fourth examples work as expected.
Text shifting
To delete text from a certain column to the end of the line, you may set
zone and shift left as in:
set zone 40 *
shift left 30 *
set zone 1 *
This code will remove characters that appear in columns 40 on by shifting
them out of the field. Reset zone to continue with the whole file.
Commands to sort, move blocks of text and change selectively
Sorting
THE can sort your file by the columns you indicate in ascending or descending
order. Sort can use more than one set of contiguous columns as the sorting
values. For example, sort a file from the current line to line 30, in ascending
order, by columns 10 t hrough 15 and 30 through 32 in that order:
sort :30 a 10 15 30 32
Sort the same file reversing the sort order in columns 30 through 32:
sort :30 a 10 15 d 30 32
Text blocks
Now mark and copy a block of text. Mark the upper left and lower right
corners by positioning there with the cursor and entering Ctrl-b. The block
may be highlighted (reverse video, blinking, etc.) if possible. Then move
the cursor to the new position of the upper left corner and enter Ctrl-c.
This copies the block.
Selective change
The selective change command works a little differently than in Xedit.
It is rather pleasant to use. Position the cursor at the beginning of all
changes, then enter the "schange" command with the ranges indicated. Enter
the command and respond to the prom pts about each proposed change.
schange/oldstring/newstring/ *
Accept any change or reject it as indicated.
A substitute for file selection from a CMS Filelist
If you enter THE without a filename, it puts you in your default filelist
(as available with the UNIX "ls" command). You may position to any file with
the cursor (use arrow keys) and enter the command Ctrl-x to open the file.
You may edit this file. When you exit from it with "file", or "qq" or "qu"
(quit), etc. you are back in your list of files, where you may choose another
file. In addition you may look at a subset of your filenames by selecting
a phrase on those lines while in THE's filelist. For exam ple:
all/25-Jul/
This would list the lines with this date on them. Recall UNIX is case sensitive
and type capitals as needed. To see all your filenames again type:
all
You may exit this THE filelist with "qq".
Click on the header to learn more about customizing THE.
Return to the
index.
The Hessling Editor is Copyright © Mark
Hessling, 1990-1998 <M.Hessling@qut.edu.au>
Last modified: April 12, 1999
|
|