I’ve been working with the simulations and automatically exporting data using wrdata, but it seems to use inconsistent space delimitation for the first row containing the vector names. For some reason that makes it challenging to import into different software. Is there a way to output data using comma or semi-colon delimitation, or to use just a single space between the headers? This might be an Ngspice issue and not KiCad so let me know and I can move to the Ngspice forums. Thanks!
This is the current ouput (human readable with multiple spaces formatting the first line)
time V(1) V(2) V(3) V(4) V(5) V(6) V(7) V(8) V(9)
0.00000000e+00 0.00000000e+00 -7.66110276e-03 -7.66110276e-03 5.22910890e+00 5.22910890e+00 -7.69994721e-01 -1.12211308e+01 1.20000000e+01 -1.20000000e+01
5.00000000e-11 1.57079568e-04 -7.64492142e-03 -7.65966265e-03 5.22910941e+00 5.22910946e+00 -7.69993052e-01 -1.12211308e+01 1.20000000e+01 -1.20000000e+01
1.00000000e-10 3.14158749e-04 -7.62686854e-03 -7.65679598e-03 5.22911025e+00 5.22911062e+00 -7.69989728e-01 -1.12211308e+01 1.20000000e+01 -1.20000000e+01
2.00000000e-10 6.28314397e-04 -7.58707610e-03 -7.64823432e-03 5.22911224e+00 5.22911421e+00 -7.69979791e-01 -1.12211308e+01 1.20000000e+01 -1.20000000e+01
4.00000000e-10 1.25660399e-03 -7.48611720e-03 -7.61453694e-03 5.22911413e+00 5.22912974e+00 -7.69940596e-01 -1.12211304e+01 1.20000000e+01 -1.20000000e+01
Currently there is no other formatting possible within ngspice/wrdata. I might add an option to print the first line with a single space between the tokens, say by adding another flag like ‘set wr_onespace’. This would be available in ngspice-42.
I have pushed a fix to ngspice git development branch pre-master-42, using a new variable wr_onespace
.
Great, thanks for adding that! Is it possible to also have the space before the first vector name removed? Here’s an example of what I have as output:
v-sweep b.xq1.bgdev#branch e.xq1.ecgd#branch e.xq1.ecgs#branch net-_q1-drain_ v-sweep v1#branch v2#branch vdd
-7.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e-01 -7.0000000e+00 -7.1748163e-15 0.0000000e+00 0.0000000e+00
-6.9000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e-01 -6.9000000e+00 -7.4246165e-15 0.0000000e+00 0.0000000e+00
-6.8000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e-01 -6.8000000e+00 -7.7160500e-15 0.0000000e+00 0.0000000e+00
-6.7000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e-01 -6.7000000e+00 -8.0491169e-15 0.0000000e+00 0.0000000e+00
-6.6000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e-01 -6.6000000e+00 -8.4099394e-15 0.0000000e+00 0.0000000e+00
-6.5000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e-01 -6.5000000e+00 -8.8123953e-15 0.0000000e+00 0.0000000e+00
-6.4000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e-01 -6.4000000e+00 -9.2564845e-15 0.0000000e+00 0.0000000e+00
-6.3000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e-01 -6.3000000e+00 -9.7560848e-15 0.0000000e+00 0.0000000e+00
It’s quite a nuisance there is no simple and working standard for exchanging tables between different software programs. Something like CSV is a weak attempt that does not work well because different parts of the world switch the meaning of comma’s and dots.
Is there a simple and universally adopted standard for data exchange in such tables?
Maybe json or S-expressions would be useful? (Just guesses).
There is.
It’s called “Tab delimited”, it’s international and avoids the comma/period decimal problem.
All spreadsheet programs understand this format.