I want to export data nicely with NumberForm, However it displays Ok in the note book, but not the exported file.
Here is the code:
lst = {{1/10, 1/3}, {1/3, Pi}};
lst = N[lst, 10]
SetDirectory[NotebookDirectory[]];
Export["testlst.txt", lst, "Table"];
The output in the notebook is:
{{0.1000000000, 0.3333333333}, {0.3333333333, 3.141592654}}
However in the txt file it looks like(ugly, not easy to read):
0.1 0.3333333333
0.3333333333 3.141592654
How to fix this? or How to achieve the format specification such as %15.4lf
like in c
?
lst = NumberForm[lst // N, {11, 10}]
$\endgroup${{0.1000000000,
..." is simply wrong. What we get in the Notebook is: screenshot. Please correct your question formulation. $\endgroup$ToString
command appears to preserve format. $\endgroup$