I have several .mx files containing data saved to disk via DumpSave. I load a list of these files in my folder as

files = FileNames[All, ".\\data", Infinity];

Now I was trying to load them via

<< files[[1]]


<< ToExpression[files[[1]]]

or even

<< Evaluate[ToExpression[files[[1]]]]

none of which have worked. How can I load an .mx file using a string of its path?

  • 1
    $\begingroup$ files = FileNames["*.mx"]; Get[files[[1]]] $\endgroup$
    – flinty
    Aug 13, 2020 at 11:44
  • 2
    $\begingroup$ Type Get insead of the shorthand <<, which treats its RHS as a string $\endgroup$
    – Szabolcs
    Aug 13, 2020 at 12:10
  • $\begingroup$ Thanks for your help, guys! $\endgroup$
    – Kagaratsch
    Aug 13, 2020 at 15:52


Browse other questions tagged or ask your own question.