The print command is used to print vector data on-screen or to a file using output redirection.
print [/format] [col | line] expr [...]The command prints the values of the given expressions to the standard output.
If command line input can be recognized as an expression list, the print command will be invoked implicitly. In this case, the line cannot contain directives or a format string, This saves a bit of typing when using the WRspice command line as a calculator, for example.
The default is to use exponential format for all values, with the number of digits given by the numdgt variable. However this, and some other presentation attributes, can be specified in the format string, if given. If given, the format string must be the first argument, and the string must start with a '/' (forward slash) character. The syntax is further described below.
All vectors listed will be printed in the same format, except for the scale vector, which is printed by default in the col mode, which is printed with the default notation.
If line is specified, the value of each expression is printed on one line (or more if needed). If all expressions have a length of 1, the default style is line, otherwise col is the default.
If col is specified, the values are printed in columns. This is the default if any of the vectors are multi-valued. This mode makes use of the height and width variables to define the page size. By default, per-page formatting is applied, with page eject characters between pages. With column formatting, by default the scale vector (time, frequency) will be shown in the first column. If there are more vectors that can be accommodated with the page width, the print will be repeated, with a new set of columns (other than the scale) until all variables have been printed.
If the expression is ``all'', all of the vectors in the current plot are printed. If no arguments are given, the arguments to the last given print command are used. If only the format argument is given, the arguments from the last given print command other than the format are used, with the new format.
If the argument list contains a token consisting of a single period (``.''), this is replaced with the vector list found in the first .print line from the input file with the same analysis type as the current plot. For example, if the input file contains
.tran .1u 10uthen one can type ``run'' followed by ``print .'' to print v(1) and v(2).
.print tran v(1) v(2)
The related syntax .@N is also recognized, where N is an integer representing the N'th matching .print line. The count is 1-based, but N=0 is equivalent to N=1. The token is effectively replaced by the vector list from the specified .print line found in the circuit deck.
The print command is responsive to the following variables.
The following variables are all booleans, and apply only to column mode of the print command.
The syntax of the format string to the print command allows overriding the states of the switches listed above while printing. The format string, if used, must be the first argument given to the print command, and must begin with a `/' (forward slash) character. It contains no space, and is a sequence of the characters and forms shown below, all of which are optional.
The remaining options apply/unapply the switches, whose defaults are set by the print... variables described above. The format string always overrides the variables.
print /3f+ahi-ps ...Print using a fixed three decimal place format, and as if printautowidth, printnoheader, and printnoindex were set, and printnopageheader and printnoscale were unset.
print /n ...Print the vectors listed, and nothing but the vectors listed. This is useful when one wants to feed a simple list of numbers to another application.
print /n-s ...As above, but print the scale in the first column. The `-' can be used as shown to undo individual implicit settings from `n'.
print /3f v(5)This prints v(5) to three decimal places in fixed-point notation.
print /4f v(2) v(3) v(4) > myfileThis prints the vectors to four decimal places in the file "myfile".
print 2*v(2)+v(3) v(4)-v(1)This prints the computed quantities using the default format.