write
Write data to a file
General form
write [file [expression ...]]
Write vectors to file as a rawfile, which load can read back in later, and other programs can read.
Each expression is usually a vector, such as v(out) or i(vdd), but may be any expression, such as v(in)-v(out), which is written as a vector with that name. The special name all means all the vectors of the current plot, and tran1.all all those of the plot tran1. With no expressions, all is written.
With no arguments at all, everything is written to rawspice.raw, or to the file given with the -r flag on the command line. The first argument is always the file name, so write v(out) writes all the vectors to a file called v(out): to write one vector, name the file as well.
The scale of the vectors (time, frequency and so on) is written too, even if it isn't in the list. If the vectors come from more than one plot, one plot is written for each, one after the other in the same file: three vectors from one plot and two from another give two plots, of three and two vectors.
File format
The file is written in ascii unless the variable filetype is set to binary. A file is normally replaced; if the variable appendwrite is set, the plots are added to the end of it instead. See variables.
Examples
write out.raw v(out) one vector, and its scale write out.raw v(in) v(out) v(in)-v(out) write out.raw all the whole current plot write out.raw the same write both.raw ac1.all tran1.all two plots in one file set filetype=binary write out.raw all
and to read one back:
load out.raw plot v(out)