1

Would anybody know how to import a list of lists of polynomials which I exported earlier?

d = {{3*t^2 + 2*t^(-1), 5*t + 6*t^(-2) + 7*t^(-4)}, {7*t^2 + 8*t^(-1), 9*t + 10*t^(-2)}} 
Export["mydata.dat",d] 
Import["mydata.dat"] 
Out[]={{"2/t", "+", "3*t^2", "7/t^4", "+", "6/t^2", "+", "5*t"}, {"8/t", "+", "7*t^2", "10/t^2", "+", "9*t"}}

imp=Import["mydata.dat", "List"] Out[]={2/t + 3t^2 7/t^4 + 6/t^2 + 5t, 8/t + 7t^2 10/t^2 + 9t} imp[[1]] Out[]= 2/t + 3t^2 7/t^4 + 6/t^2 + 5t imp[[1]][[1]] error: Part::partd: Part specification 2/t + 3t^2 7/t^4 + 6/t^2 + 5t[[1]] is longer than depth of object. Head @ imp[[1]] Out[]=String

Exporting as "List" does not help.

EDIT: Dominic's solution of using .mx does the job. However, it uses Mathematica's internal (obscure) format and that does not work for me. I need an understandable data format, so that I can generate my own data in that format.

Adam
  • 153
  • 4

0 Answers0