
Notes on the "rawfile" format generated by Berkeley spice3 and ng-spice.
Sadly, neither program documents the file format.

Top of an example file:

Title: * RC circuit driven by square wave 
Date: Sun Oct  8 22:29:16  2000
Plotname: Transient Analysis
Flags: real
No. Variables: 6
No. Points: 85      
Command: version 12
Variables:
        0       time    time
        1       gnd     voltage
        2       a       voltage
        3       b       voltage
        4       va#branch       current
        5       vgnd#branch     current
Values:
0               0.000000000000000e+00
        0.000000000000000e+00
        0.000000000000000e+00
        0.000000000000000e+00
        0.000000000000000e+00
        0.000000000000000e+00
1               5.000000000000002e-12
        0.000000000000000e+00
        0.000000000000000e+00
        0.000000000000000e+00
        0.000000000000000e+00
        0.000000000000000e+00



The header consists of lines with "name: value" parameter assignments.

Following a Variables: line, are "No. Variables" lines each containing
an index, name, and variable-type.

Following a "Values:" line is the data.
Each chunk of data represents a row, and contains "No. Variables" lines.
The first line of a chunk starts with an index or point number.
Indexes run 0 through "No. points" minus one.


If "Flags: complex" instead of "Flags: real", the each data point
is a complex pair seperated by a comma:

0               1.000000000000000e+00,7.227131787662363e-270
        0.000000000000000e+00,0.000000000000000e+00
        0.000000000000000e+00,0.000000000000000e+00
        1.000000000000000e+00,0.000000000000000e+00
        8.638022681143612e-01,-9.279561053152983e-08


Assumed to be "real,imaginary" but not confirmed.
"Complex" is an all-or-nothing situation.

Instead of a "Variables:" section there may be a "Binary:" section.
In this case, the data appears to be 64-bit double-precion floating point,
with "No. variables" * "No. points" doubles, following immediately after
the newline in "Binary:\n"



