I would like to export an array to a csv file with a specific type of delimiter and a specific notation of the numbers (in this case scientific notation 1.234E-02).
How can I achieve this in a general form?
I now there is (reference: How to export CSV from Mathematica?)
Export["dataset.csv", dataset, "CSV"]
but I do not know how to change the delimiter (reference for similar problem: Comma issue from number point in csv export! - is there a nicer way now?) and the notation of the numbers in the csv file seems arbitrary. I would like to have something like a format specifier for the numbers. In particular I would like to have something like 1.234E-02 for the numbers format (which I guess is referred to as scientific).
ScientificFormis a wrapper which changes the printed format, but not the actual values. SoToStringis necessary to actually output the numbers in scientific form for exporting. See here for details.Also, this
– Musang Oct 19 '16 at 14:53NumberFormatfunction as is will print2Eif your exponent is 0. You might want to consider using this function afterNumberFormatif you want to avoid this:(Row[{#1, If[#3 == "", #3, "E"], #3}] &)Exportwhich is necessary so thatdatasetis exported as a list of numbers, allowing proper formatting. – Musang Oct 19 '16 at 16:08