next up previous contents index
Next: The sced Command Up: Input and Output Commands Previous: The load Command   Contents   Index


The print Command

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. The default is to use exponential format for all values, with the number of digits given by the numdgt variable. However, a fixed-point format can be specified. The format must be the first token after print and has the form of a forward slash, followed by an optional integer, followed by ``f''. The optional integer supplies the number of decimal places printed, and the ``f'' indicates fixed-point notation. Any other character will revert to the default exponential notation. If the number isn't given, the default is the value of the numdgt variable if set, or 5.

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 col is specified, the values are printed in columns, with the scale in the leftmost column on each page. This is the default for multi-valued vectors. The scale vector (time, frequency) will always be in the first column unless the variable noprintscale is true.

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 no arguments are given, the arguments to the last given print command are used. 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 10u
.print tran v(1) v(2)
then one can type ``run'' followed by ``print .'' to print v(1) and 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 options width, height, and nobreak are effective for this command, however if printing on-screen, the actual screen or window size will be used. If the expression is ``all'', all of the vectors available are printed. Thus ``print col all > file'' will print everything to the file in SPICE2 format.

Examples:

print /3f v(5)
This prints v(5) to three decimal places in fixed-point notation.
print /4f v(2) v(3) v(4) > myfile
This 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.


next up previous contents index
Next: The sced Command Up: Input and Output Commands Previous: The load Command   Contents   Index
Stephen R. Whiteley 2012-09-24