# How to export numbers to txt in ScientificForm

I need to write data in scientific notation in a .dat file. For example Export["1.dat", {123.}]. I want to get 1.23e2 in 1.dat. But if I use ScientificForm I can only get ScientificForm[{123.}].

• This can help you: mathematica.stackexchange.com/a/35375/280 – Alexey Popkov May 16 '18 at 2:00
• Sorry But i don't think it works.Using his code my export is still 123 not 1.23e2, His method is mainly used to promote speed. – XinBae May 16 '18 at 3:10
• You can replace FortranForm with ScientificForm or NumberForm (as in the answer by Carl Woll) in that solution in order to get the desired format. – Alexey Popkov May 16 '18 at 4:04

Maybe you can use NumberForm and OutputForm as follows:

Export[
"tst.dat",
OutputForm @ NumberForm[
N @ {Pi, E^3},
NumberFormat -> (Row[{#1, "e", #3}]&),
ExponentFunction -> Identity
]
];
Import["tst.dat", "String"]


"{3.14159e0, 2.00855e1}"

• Thanks ! it is the format i want.But it caused another problem. How can i remove the {} in "tst.dat"? – XinBae May 16 '18 at 6:34