HP 3000 Manuals

Creating and Editing Files [ HP 3000 Series 9X8LX Computer Systems Task Reference ] MPE/iX 5.0 Documentation


HP 3000 Series 9X8LX Computer Systems Task Reference

Creating and Editing Files 

The text editor EDIT/3000 is a Hewlett-Packard subsystem that comes with
your HP 3000 system.  The editor has its own special set of commands and
subcommands that give you flexibility in creating, modifying, and
deleting files.

To start EDIT/3000 

With EDIT/3000 you can create text files, command files, and job files.

The command EDITOR starts the subsystem EDIT/3000.  Just type the command
name, and press Return:

     :EDITOR Return 

When the editor starts, your screen should look similar to this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| :EDITOR                                                              |
| HP32201A.07.17 EDIT/3000 THU, FEB 15, 1993, 4:00PM                   |
| (C) HEWLETT-PACKARD CO. 1990                                         |
| /_                                                                   |
|                                                                      |
________________________________________________________________________

            

Notice that the system prompt has disappeared and has been replaced by
the editor prompt, the slash (/).  The editor prompt (/) allows you to
issue EDIT/3000 commands.  When the editor prompt (/) and the cursor are
alone on a blank line, the editor is in command mode.  In command mode,
you can issue EDIT/3000 commands, but you cannot create lines of text.

To leave EDIT/3000 

To leave the editor program, use the END (or E) command.  Try this now:

     /END Return 

Your screen should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| /END                                                                 |
| END OF SUBSYSTEM                                                     |
| :_                                                                   |
|                                                                      |
________________________________________________________________________

            

The computer once again displays the system prompt.

To begin creating a text file 

Start the editor again using the EDITOR command, enter:

     :EDITOR 

Does the editor slash prompt (/) appear on your screen?  If it does, you
are in command mode.  You can enter commands in all uppercase letters,
all lowercase letters, or a combination of uppercase and lowercase
letters.

To add lines of text 

The command to start entering lines of text in the editor is ADD or A.

Try typing the ADD command now:

     /ADD Return 

It should look like this on your screen:
________________________________________________________________________
|                                                                      |
|                                                                      |
| /ADD                                                                 |
|     1      _                                                         |
|                                                                      |
________________________________________________________________________

            

The ADD command puts the editor in edit mode.  Now you can enter your
text.  The editor provides the number of the next line where you will be
typing.  Since you have started a new file, the first line number is 1.

You are now ready to begin typing
text.

Try typing this now:

     I am learning to use the EDIT/3000Return 

Does your screen look like this?
________________________________________________________________________
|                                                                      |
|                                                                      |
| /ADD                                                                 |
|     1   I am learning to use the EDIT/3000                           |
|     2   _                                                            |
|                                                                      |
________________________________________________________________________

            

Notice that the editor labeled the first line 1.  Each time you press
Return, the editor gives you a new line, with the next number in
sequence.  As you continue, keep in mind these guidelines:

   *   Type the way you would on a typewriter.

   *   Type no more than 72 characters on a line.

   *   Press Return to start a new line.

Type the rest of these lines, and notice where to press the Return key:

     text editor program.  It seems fairly simpleReturn 
     to use.  It has dozens of its own commands. ManyReturn 
     of them are quite elaborate.  It even usesReturn 
     subcommands.Return 

Your file should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| /ADD                                                                 |
|     1   I am learning to use the EDIT/3000                           |
|     2   text editor program.  It seems fairly simple                 |
|     3   to use.  It has dozens of its own commands. Many             |
|     4   of them are quite elaborate.  It even uses                   |
|     5   subcommands.                                                 |
|     6   _                                                            |
|                                                                      |
________________________________________________________________________

            

Notice that the cursor is on an empty line.  You are now ready to change
back to command mode.  To do this, enter two slashes on line 6.

Your screen should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| /ADD                                                                 |
|     1   I am learning to use the EDIT/3000                           |
|     2   text editor program.  It seems fairly simple                 |
|     3   to use.  It has dozens of its own commands. Many             |
|     4   of them are quite elaborate.  It even uses                   |
|     5   subcommands.                                                 |
|     6                                                                |
| ...                                                                  |
| /                                                                    |
|                                                                      |
________________________________________________________________________

            

To stop adding text, enter two slashes on the empty line:

     // Return 

The editor is now in command mode.  You can execute EDIT/3000 commands
again.

Remember that any line that ends in //Return is discarded.  EDIT/3000
discards that line and waits for your next command.

To look at your text file 

At this point, you may wish to see all of the file that you have just
written.

To see all of your file on the screen, use the LIST ALL command.  Try
this now:

     /LIST ALL Return 

You should see all of the file scroll upward on your screen.  If it were
a long file, you might need to use the Ctrl S keys to stop the scrolling
and then the Ctrl Q to continue the scrolling.

You can display a single line of text.  Try this now:

     /LIST 4 Return 

You should see line 4 on your screen.

You can also display a portion of a file.  Enter:

     /LIST 2/4 Return 

This tells the computer to show you lines 2 through 4.  You should see
lines 2, 3, and 4 scroll into view.

To save a text file 

In order to keep your text permanently, you must save the file to disk.

The command to save or keep a file permanently is KEEP or K. This saves
the file on a computer disk.  The editor requires that you give the file
a name when you keep it on the disk.  This time call it FILE1.

Enter:

     /KEEP FILE1 Return 

You will know that your file has been kept when the slash prompt (/)
reappears.

To list your files from within EDIT/3000 

Now that you have created and kept a file, how can you keep track of any
or all of the files that you save?

The LISTFILE command alphabetically displays file names to your terminal
screen.  But the LISTFILE command is a system command, not an editor
command.  Most subsystems allow you to enter system commands from within
the subsystem.  In order to do so, you must precede the command with the
system prompt.  To list the files now, enter LISTFILE with a colon (:)
preceding it.

     /:LISTFILE Return 

Your screen should look something like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| /:LISTFILE                                                           |
|                                                                      |
| FILENAME                                                             |
|                                                                      |
| FILE1                                                                |
|                                                                      |
________________________________________________________________________

            

FILE1 is the file that you just created.  To exit, enter:

     /EXIT 

Editing a text file 

Using the editor, you have learned to create and save files.  Now you
will learn how to edit your files.

To open a file for editing 

From within the editor and at the slash prompt (/), enter:

     /TEXT FILE1 Return 

The TEXT command instructs the computer to find the specified file
(FILE1), and, if it exists, to put it into the editor's workspace for
viewing, for printing, or for editing.

To display the entire FILE1 file to your screen, enter:

     /LIST ALL 

This file should look familiar to you by now.

To add additional lines of text 

The ADD command automatically begins adding lines at the end of the
existing file, no matter where the end of the file is found.

At the slash prompt (/), enter:

     /ADD 

This adds a new blank line labeled 6 onto the screen.  You are now ready
for typing.  Add the following lines 6 through 9 to your file.

     When using the editor, remember that correctionsReturn 
     have to be made one step at a time.  After each step,Return 
     you can see what you accomplished by pressingReturn 
     Return.Return 
     // Return 

Look at the new text.  Enter:

     /LIST ALL 

Your screen should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| /LIST ALL                                                            |
|     1   I am learning to use the EDIT/3000                           |
|     2   text editor program.  It seems fairly simple                 |
|     3   to use.  It has dozens of its own commands. Many             |
|     4   of them are quite elaborate.  It even uses                   |
|     5   subcommands.                                                 |
|     6   When using the editor, remember that corrections             |
|     7   have to be made one step at a time.  After each step,        |
|     8   you can see what you accomplished by using                   |
|     9   the LIST ALL command.                                        |
| ...                                                                  |
| /                                                                    |
|                                                                      |
________________________________________________________________________

            

To add lines in the middle of a text file 

Now try adding text in the middle of your file.  To do this, use the ADD
command with a line number.  This starts a new line immediately after the
number that you have specified.  Try this:

     /ADD 5 

and at line number 5.1 type the following:

     5.1  I decided to add lines in the middle ofReturn 
     5.2  my text file.Return 
     5.3  // Return 

Once again you needed to use two slashes to indicate the end of your
text.

At the slash prompt, enter:

     /LIST ALL 

Your screen should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
|     1   I am learning to use the EDIT/3000                           |
|     2   text editor program.  It seems fairly simple                 |
|     3   to use.  It has dozens of its own commands. Many             |
|     4   of them are quite elaborate.  It even uses                   |
|     5   subcommands.                                                 |
|     5.1 I decided to add more lines in the middle                    |
|     5.2 of my text file.                                             |
|     6   When using the editor, remember that corrections             |
|     7   have to be made one step at a time.  After each step,        |
|     8   you can see what you accomplished by using                   |
|     9   the LIST ALL command.                                        |
|                                                                      |
________________________________________________________________________

            

Notice that to insert new lines between 5 and 6, the editor adds the new
lines with increments of 0.1.  It can also add lines in increments of
0.01 or 0.001.

To erase a line 

The DELETE or D command erases a line or a range of lines.  Try now to
erase the last line.  Enter:

     /DELETE 9 Return 

Your screen should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| /DELETE 9                                                            |
|     9 the LIST ALL command.                                          |
|                                                                      |
________________________________________________________________________

            

The DELETE command displays the line that you erased.  See for yourself.
Use the LIST ALL command to verify that line 9 has been deleted.  Enter:

     /LIST ALL Return 

Your screen should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
|     1   I am learning to use the EDIT/3000                           |
|     2   text editor program.  It seems fairly simple                 |
|     3   to use.  It has dozens of its own commands. Many             |
|     4   of them are quite elaborate.  It even uses                   |
|     5   subcommands.                                                 |
|     5.1 I decided to add more lines in the middle                    |
|     5.2 of my text file.                                             |
|     6   When using the editor, remember that corrections             |
|     7   have to be made one step at a time.  After each step,        |
|     8   you can see what you accomplished by using                   |
|                                                                      |
________________________________________________________________________

            

You can delete consecutive lines by specifying the line range that you
wish to erase.  Try now to erase lines 6 through 8 of your document.
Enter:

     /DELETE 6/8 Return 

Use the LIST ALL command to make sure the lines that were deleted.
Enter:

     /LIST ALL 

Your screen should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
|     1   I am learning to use the EDIT/3000                           |
|     2   text editor program.  It seems fairly simple                 |
|     3   to use.  It has dozens of its own commands. Many             |
|     4   of them are quite elaborate.  It even uses                   |
|     5   subcommands.                                                 |
|     5.1 I decided to add more lines in the middle                    |
|     5.2 of my text file.                                             |
|                                                                      |
________________________________________________________________________

            

To renumber the lines 

Your file should end with line 5.2.  To reorder the numbering, use the
GATHER command.  Try this with your file now:

     /GATHER ALL Return 

To see your screen, enter:

     /LIST ALL Return 

Your screen should now show lines 1 through 7.

To ensure that all of your changes are kept on the system, try saving
your file now.  Enter the KEEP command now:

     /KEEP FILE1 

Your screen should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| FILE1                                                                |
| FILE1 ALREADY EXISTS - RESPOND YES TO PURGE OLD AND KEEP NEW         |
| PURGE OLD ?                                                          |
|                                                                      |
________________________________________________________________________

            

To modify a text line 

The MODIFY command tells the computer to let you edit specific text
lines.  For example, MODIFY 2 allows you to edit line 2 in your text
file.

The MODIFY command in the editor uses three commands:  D, I, and R.

D                         Deletes the character above it.  For instance, DDD deletes
                          the character above each of the three Ds.

I                         Inserts character(s) above the I.

R                         Replaces character(s) above the R with new characters.

Try each of these commands on your file now.

   1.  Delete the word "program" on line 2.  Use the spacebar to move the
       cursor under the first character that you want to delete.  Try
       this now:

            /MODIFY 2 

       Your screen should look like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| /MODIFY     2                                                        |
| text editor program.  It seems fairly simple                         |
|                                                                      |
|                                                                      |
|                     DDDDDDDReturn                                    |
| text editor.  It seems fairly simple                                 |
|                                                                      |
________________________________________________________________________

            

   2.  Try now to insert the word "two" on line 6.  Again, use the
       spacebar to move the cursor to the first character of the text
       that you want to modify.

            /MODIFY 6 

       Your screen looks like this:
________________________________________________________________________
|                                                                      |
|                                                                      |
| /MODIFY     6                                                        |
| I decided to add more lines in the middle                            |
|                                                                      |
|                                                                      |
|                              ItwoReturn                              |
| I decided to add two more lines in the middle                        |
|                                                                      |
________________________________________________________________________

            

   3.  Replace the word "even" with the word "also" in line 4.

            /MODIFY 4 
________________________________________________________________________
|                                                                      |
|                                                                      |
| MODIFY     4                                                         |
|                                                                      |
|                                                                      |
| of them are quite elaborate.  It even uses                           |
|                                                          RalsoReturn |
| of them are quite elaborate.  It also uses                           |
|                                                                      |
________________________________________________________________________

            

Notice that the editor prompts you for the changes that you want to make.
When the line is correct, press Return again to tell the editor to accept
the line the way it is.



MPE/iX 5.0 Documentation