Export Global Quantity Values (Custom Format)
I understand that we can use the Print[] function in a PostOperation
to export to a file, e.g., Print [ Q, OnRegion Conductor, Format SimpleTable, File > "Q.txt"]
. However, this doesn't really give us the option of outputting data in any desired format -- we seem to be limited to the options of Format
, e.g., SimpleTable
In the electrostatics tutorial for example, we have a global quantity Q
. Say I had multiple such quantities Q~{i}
, and I wanted to export a list of them in CSV format. Is there a way to easily print out the global values to a file, in any desired format? I've tried StoreInVariable $Q~{i}
and then directly writing Printf(Sprintf("%g", $Q~{i})) >> "Q.txt";
-- but OneLab gives an error saying it doesn't recognize the global variable symbol $
.
Is there any way the value of a Global Quanity can be directly written to a file, in a custom format?
Thank you!