Rawfile format
The format of the files written by spice -b -r, the write command and run file, and read by the load command.
A rawfile holds one or more plots, one after another. Each plot is a text header followed by its data, which is either text (Values:) or binary (Binary:). The filetype variable chooses between them (ascii or binary); the default comes from SPICE_ASCIIRAWFILE.
Header
Title: the circuit's title line Date: date and time of the run Plotname: e.g. Transient Analysis Flags: real | complex [unpadded] No. Variables: n No. Points: points Dimensions: d1,d2,... (only for multi-dimensional plots) Command: a command (any number) Option: name [= value] (any number) Variables: 0 name type [attributes] 1 name type [attributes] ...
Flagscomplexif any vector is complex (as in an ac analysis), otherwisereal.unpaddedmeans shorter vectors stop at their own length instead of being padded with zeros to the length of the longest; thenopaddingvariable writes unpadded files.No. Points- The length of the longest vector.
Dimensions- The dimensions of the longest vector, when it has more than one (as in the merged plot of a .step run).
Command- A command run when the plot is loaded.
Option- A variable setting saved with the plot.
Variables- One line per vector: its index, name and type (
time,frequency,voltage,currentand so on), optionally followed bymin=,max=,color=,scale=,grid=,plot=anddims=attributes. The first vector is the plot's scale.
Header keywords are not case sensitive when a file is read.
Text data
Values: 0 value of vector 0 value of vector 1 ... 1 value of vector 0 ...
For each point, the point number is followed by the value of each vector in turn, one per line, indented with a tab. Values are written in %e format with 15 digits after the decimal point, or as many as the rawfileprec variable gives. In a complex plot every value is written as real,imaginary.
For example, the header of the ac results of examples/meas_demo.cir, written by spice -b -r:
Title: meas_demo.cir - .meas on an RC low pass: tau = 1us, corner 159Hz Date: Mon Sep 28 15:18:28 2026 Plotname: AC Analysis Flags: complex No. Variables: 7 No. Points: 401 Command: version 3f5 Variables: 0 frequency frequency grid=3 1 V(1) voltage 2 V(2) voltage 3 V(10) voltage 4 V(11) voltage 5 va#branch current 6 vin#branch current Values: ...
Binary data
Binary: point 0: a double for each vector point 1: ...
After the Binary: line, the data follows directly as native double values: for each point, one value per vector in turn. In a complex plot each value is two doubles, real then imaginary. Binary files are smaller and faster to read, but are only portable between machines with the same floating-point format and byte order; use text files to move data between machines, or to edit it.