HP 3000 Manuals

Lesson 5 Displaying File Contents [ Using the 900 Series HP 3000: Fundamental Skills Module 5: Working with Files ] MPE/iX 5.0 Documentation


Using the 900 Series HP 3000: Fundamental Skills Module 5: Working with Files

Lesson 5 Displaying File Contents 

Lesson 5 presents the command to display the contents of text files.

   *   the command to display the contents of a text file:  PRINT

Up to now you have used the editor to see a file, but you can display the
contents of a text file on the screen without starting the editor to text
in the file and list it.

You should be in MYGROUP.

Displaying an entire file 

To see the contents of DOCUMENT on the screen, use PRINT command this
way:

     PRINT DOCUMENTReturn 

Displaying selected lines 

To see only lines 3 through 6 of the file, enter this:

     PRINT DOCUMENT;START=3;END=6Return 


NOTE Notice the punctuation? The semicolons ( ; ) are needed here.
The PRINT parameters. Here is what happens: * START= tells the computer which line of the file to show first. * END= tells the computer which line to show last. * The semicolons ensure that the computer knows where one parameter ends and another begins. What do you suppose the following prints to the screen: PRINT DOCUMENT;START=-3 Try it. The last three lines of the file DOCUMENT are printed on the screen. This happens because you specified a minus sign (-) ahead of the number 3, so the instruction becomes: start printing at the third line from the end.
NOTE New users of MPE/iX should always specify a file name when using the PRINT command. Entering PRINTReturn puts MPE/iX into a create mode, and that causes confusing results on the terminal screen. If you do this by accident, enter :eod (colon included) by itself on a new line and pressReturn. :EOD (colon included) by itself on a new line sends a message to the computer--End Of Data.


MPE/iX 5.0 Documentation