Mathematica 9 is now available
Student Support Forum
Student Support Forum > General > > "Exporting/Importing Nested List"

Post Reply:
Email Address:

Please send email when my message is replied to.

Url (optional):
Message: view original message?
Attachment (optional):
Please answer this:2+5 =

Original Message (ID '78232') By Bill Simpson:
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]]