I have seen the answer How to export data in scientific form but it is only partly helping me.
I have the list of data which I want to export in a formatted form to a file. In addition I want to prepend a header.
What I tried:
list = {0.004,0.00273904,0.00447323,0.00344523,0.00327233,0.00375527,0.055290,0.008,0.00273586,0.00446845,0.00344505,0.00327311,0.00376325,0.06050960,0.012,0.00273243,0.00446187,0.00344387,0.00327414,0.00377089,0.06586520,0.016,0.0027274,0.00445676,0.00344366,0.00327586,0.00377908,0.07112480,0.02,0.00272475,0.004451,0.00344402,0.0032789,0.0037872,0.07636090,0.024,0.0027227,0.00444807,0.00344451,0.00328181,0.0037949,0.081729};
formatted = Partition[Map[NumberForm[#, {12, 9}] &, list], 7];
header = {" time x1 y1 x2 y2 x3 y3"};
output = Prepend[formatted, header];
Export["data.txt", output, "Table"];
The content of the file is:
time x1 y1 x2 y2 x3 y3
0.004000000 0.002739043 0.004473226 0.003445232 0.003272333 0.003755268 0.05529000
0.008000000 0.002735863 0.004468450 0.003445050 0.003273114 0.003763252 0.06050960
0.012000000 0.002732431 0.004461866 0.003443870 0.003274136 0.003770894 0.06586520
0.016000000 0.002727400 0.004456763 0.003443659 0.003275864 0.003779077 0.07112480
0.020000000 0.002724752 0.004450998 0.003444017 0.003278901 0.003787201 0.07636090
0.024000000 0.002722704 0.004448069 0.003444513 0.003281807 0.003794901 0.08172900
I have two questions:
a. How can I prepend the header more elegantly?
b. How can I export the data in exponential form whereby each number should have the same form (same number of digits before the comma, another same number of digits after the comma) e.g.:
0.004000000 -> 4.000000E-3
...
0.081729000 -> 8.172900E-2
I expect that there must be a Mathematica built in solution to do the upper formatting instead of writing own functions.

Datasetcan help you $\endgroup$0.00711248to7.11248E-3. $\endgroup$