next up previous contents index
Next: Execution of Commands Up: Command Syntax Previous: On-Line Help

    
Input/Output Redirection in Midas

Similar to Unix MIDAS commands also accept input from an ASCII file instead of an input line typed on the terminal. For example, you can use host commands to create a list of files and then execute a MIDAS command on all files in that list:
Midas 045> $ ls bb*.bdf >input.dat
Midas 046> STATISTICS/IMAGE <input.dat
This command sequence will execute the STATISTICS/IMAGE command for all frames in the file input.dat, i.e. all images beginning with `bb'.
For more elaborate processing of groups of files you should use MIDAS catalogs and the STORE/FRAME command (see section 3.9 for detailed info about catalogs).
  
Different ways exist to save the output of a MIDAS command in an ASCII file besides just using the logfile. There is a set of PRINT/... commands to print out the contents of the different MIDAS data objects, e.g. PRINT/TABLE. By default the output from these commands is sent to a printer but this can be changed to a file via the ASSIGN/PRINT command. So, if you want an ASCII copy of a MIDAS table, you do:
Midas 088> ASSIGN/PRINT file mytable.dat
Midas 089> PRINT/TABLE mytable
  
Another possibility which is applicable to all MIDAS commands, not just the PRINT commands, is to specify the output file directly in the command. Thus,
Midas 089> WRITE/TABLE mytable >mytable.dat
is equivalent to the two commands above. The file mytable.dat is created in the current directory. If you want to append the data to an existing file, use
Midas 090> WRITE/TABLE mytable >>mytable.dat
Midas 090> WRITE/TABLE mytable >terminal
only produces output on the terminal, i.e. it's the same as
Midas 090> WRITE/TABLE mytable
but is useful if you want to provide optional file output in a procedure (see section 3.6.2 for more details about that).

In case, the output should go to a file and also be displayed in the MIDAS command window, use
Midas 091> WRITE/TABLE mytable >mytable.dat+terminal
If you want to suppress the output completely use the special name Null for the output file, e.g.
Midas 092> WRITE/TABLE mytable >Null
will omit all output. No file Null is created.

Currently it is not possible to redirect the input as well as the output in the same command line, e.g.
Midas 046> STATISTICS/IMAGE <input.dat >output.dat
is not possible.

Note
No space should be between the <, > or >> and the in/output ASCII file names!
This output redirection scheme has been modeled after the way it is done in Unix but it also works on VMS systems.


next up previous contents index
Next: Execution of Commands Up: Command Syntax Previous: On-Line Help
Petra Nass
1999-06-09