| Author |
Comment/Response |
Bill Simpson
|
10/23/12 8:06pm
It looks like Export is happy to deal with constants, vectors and matricies, but when the list gets deeper it appears to start turning bits into strings.
In[1]:= test={{{1,2},3},{3,4}};
Export["out.dat",test,"String"];
FullForm[Import["out.dat"]]
Out[3]//FullForm= List[List["{{{1,","2},","3},","{3,","4}}"]]
But two dimensional matricies work
In[4]:= test={{5.7,4.3},{-1.2,7.8}};
Export["out.dat",test];
FullForm[Import["out.dat"]]
Out[6]//FullForm= List[List[5.7`,4.299999999999999`],List[-1.2`,7.799999999999999`]]
Here is a workaround IF you are using this for correctly formatted lists of any depth.
In[7]:= test={{{1,2},3},{3,4}};
Put[test,"out.dat"];
Get["out.dat"]
Out[9]= {{{1,2},3},{3,4}}
In[10]:= FullForm[%]
Out[10]//FullForm= List[List[List[1,2],3],List[3,4]]
URL: , |
|