Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am having an issue about how to export data in its scientific form using Mathematica.

To be concrete, I define a list

alist = {2344. 1111111, 0.0002223344};
ScientificForm[%]
Export["test.dat", %]

but it turns out that doesn't work. Is there any other way to achieve this? Also, what can I do to control the number of digits exported?

Any idea?

share|improve this question

1 Answer 1

Export["test.dat",
   NumberForm[
     alist, 
     NumberFormat -> (Row[{#1, "E", #3}] &), 
     ExponentFunction -> (3 Quotient[#, 3] &)
   ], 
   "Table"
]

(*   ==> {2.34411E3, 222.334E-6} *)
share|improve this answer
    
I thought a similar thing is possible with CForm but I failed to set it as Listable. –  Gregory Rut Mar 1 at 22:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.