<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 98.1p1 release (March 2nd, 1998) originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Input/Output Redirection in Midas</TITLE> <META NAME="description" CONTENT="Input/Output Redirection in Midas"> <META NAME="keywords" CONTENT="vol1"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <LINK REL="STYLESHEET" HREF="vol1.css"> <LINK REL="previous" HREF="node35.html"> <LINK REL="up" HREF="node31.html"> <LINK REL="next" HREF="node37.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html933" HREF="node37.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html929" HREF="node31.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html925" HREF="node35.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html931" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <A NAME="tex2html932" HREF="node216.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="icons.gif/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html934" HREF="node37.html">Execution of Commands</A> <B> Up:</B> <A NAME="tex2html930" HREF="node31.html">Command Syntax</A> <B> Previous:</B> <A NAME="tex2html926" HREF="node35.html">On-Line Help</A> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION00645000000000000000"> </A><A NAME="1751"> </A> <A NAME="output-redirection"> </A> <BR> Input/Output Redirection in Midas </H2> <P> 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: <BR> <TT>Midas 045> $ ls bb*.bdf >input.dat </TT> <BR> <TT>Midas 046> STATISTICS/IMAGE </TT><<TT>input.dat</TT> <BR> This command sequence will execute the <TT>STATISTICS/IMAGE</TT> command for all frames in the file <I>input.dat</I>, i.e. all images beginning with `bb'. <BR> For more elaborate processing of groups of files you should use MIDAS catalogs and the <TT>STORE/FRAME</TT> command (see section <A HREF="node50.html#catalogs-in-midas">3.9</A> for detailed info about catalogs). <BR> <BR> 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 <TT>PRINT/...</TT> commands to print out the contents of the different MIDAS data objects, e.g. <TT>PRINT/TABLE</TT>. By default the output from these commands is sent to a printer but this can be changed to a file via the <TT>ASSIGN/PRINT</TT> command. So, if you want an ASCII copy of a MIDAS table, you do: <BR> <TT>Midas 088> ASSIGN/PRINT file mytable.dat</TT> <BR> <TT>Midas 089> PRINT/TABLE mytable</TT> <BR> <BR> Another possibility which is applicable to all MIDAS commands, not just the <TT>PRINT</TT> commands, is to specify the output file directly in the command. Thus, <BR> <TT>Midas 089> WRITE/TABLE mytable </TT>><TT>mytable.dat</TT> <BR> is equivalent to the two commands above. The file <I>mytable.dat</I> is created in the current directory. If you want to append the data to an existing file, use <BR> <TT>Midas 090> WRITE/TABLE mytable </TT>>><TT>mytable.dat</TT> <BR> <TT>Midas 090> WRITE/TABLE mytable >terminal</TT> <BR> only produces output on the terminal, i.e. it's the same as <BR> <TT>Midas 090> WRITE/TABLE mytable</TT> <BR> but is useful if you want to provide optional file output in a procedure (see section <A HREF="node40.html#symbol-substitution">3.6.2</A> for more details about that). <P> In case, the output should go to a file and also be displayed in the MIDAS command window, use <BR> <TT>Midas 091> WRITE/TABLE mytable </TT>><TT>mytable.dat+terminal</TT> <BR> If you want to suppress the output completely use the special name <TT>Null</TT> for the output file, e.g. <BR> <TT>Midas 092> WRITE/TABLE mytable </TT>><TT>Null</TT> <BR> will omit all output. No file <TT>Null</TT> is created. <P> Currently it is not possible to redirect the input as well as the output in the same command line, e.g. <BR> <TT>Midas 046> STATISTICS/IMAGE </TT><<TT>input.dat </TT>><TT>output.dat</TT> <BR> is not possible.<BLOCKQUOTE> <DIV ALIGN="CENTER"> <B>Note</DIV> <I>No space should be between the </I></B><<B><I>, </I></B>><B><I> or </I></B>>><B><I> and the in/output ASCII file names! <BR> This output redirection scheme has been modeled after the way it is done in Unix but it also works on VMS systems.</I></B></BLOCKQUOTE> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html933" HREF="node37.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html929" HREF="node31.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html925" HREF="node35.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html931" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <A NAME="tex2html932" HREF="node216.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="icons.gif/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html934" HREF="node37.html">Execution of Commands</A> <B> Up:</B> <A NAME="tex2html930" HREF="node31.html">Command Syntax</A> <B> Previous:</B> <A NAME="tex2html926" HREF="node35.html">On-Line Help</A> <!--End of Navigation Panel--> <ADDRESS> <I>Petra Nass</I> <BR><I>1999-06-09</I> </ADDRESS> </BODY> </HTML>