Could anyone explain to me what in the world is going on here and please help me in reading in dummy.dat properly?
dummy = Table[{k, 2*k/m}, {k, 1, 10}, {m, 1, 10}];
Dimensions[dummy]
(*{10, 10, 2}*)
Export["dummy.dat", dummy];
dummyImport = Import["dummy.dat", "Data"];
Dimensions[dummyImport]
(*{10, 20}*)
Edit: Just in case anyone exports their precious data as above and needs to read it in properly, the following simple fix worked for me:
dummyReconst = Table[
{
ToExpression[StringJoin[StringCases[dummyImport[[m, k]], RegularExpression["[^{},]"]]]],
ToExpression[StringJoin[StringCases[dummyImport[[m, k + 1]], RegularExpression["[^{},]"]]]]},
{m, 1, Dimensions[dummyImport][[1]]
}, {k, 1, Dimensions[dummyImport][[2]], 2}
];
Dimensions[dummyReconst]
(*{10, 10, 2}*)


When I do what you suggest, I get this:
codeIn[29]:= dummy = Table[{k, 2*k/m}, {k, 1, 10}, {m, 1, 10}];In[30]:= Dimensions[dummy]
Out[30]= {10, 10, 2}
In[31]:= Export["~/Desktop/dummy.csv", dummy];
In[32]:= dummyImport = Import["~/Desktop/dummy.csv"];
In[33]:= Dimensions[dummyImport]
Out[33]= {10, 10}
So still not the right results.
– Name Apr 04 '12 at 11:23At any rate, I'll save this answer for future reference ... the actual data I exported and am now trying to import took a couple of hours to compute, so maybe I'll have to try some regular expression stuff. Kind of disappointing how Mathematica fails on simple issues.
Anyways, thanks again for your help and cheers to Dresden (Julicher gave a really fantastic talk over here a little while ago!).
– Name Apr 04 '12 at 11:46Exportsupports MAT types (Matlab format) helped... – acl Apr 04 '12 at 14:41