# DumpSave for the forgetful

A few weeks ago I created a big matrix, and in order not to have to recreate it, I stored it using DumpSave["file.mx", variable]. Now I want to read it back in and so I use <<file.mx. It appears to work fine and to load the file (which takes a few moments because it is 54 MB in size). Now the problem: I have forgotten what I called the matrix, that is, what name variable I used in when I saved it. My generating command is unfortunately not around any more. Is there any way of figuring out what my variable was called or more directly, how to access my data now that it is loaded?

-
I suggest that you also save the notebook you had been working on, and that you use this same notebook to store and load the DumpSave. That way you can resume your workflow exactly where you left off, and you won't have to remember the name of your variables. –  becko May 11 at 5:50
@becko I do actually have the notebook, but I saved a number of things at different times and evidently erased the particular DumpSave that I ended up needing. Your point is well taken: be more careful! –  bill s May 11 at 6:16
Related: (2900) –  Mr.Wizard May 11 at 7:55
@Mr. Wizard - My problem was actually simpler than in the link, and xsLittlegrass's suggestion of looking at all variables solved it nicely. I did try opening in a text editor, but the file is 54 MB and I wasn't able to spot the right variable name -- presumably it is there somewhere. –  bill s May 11 at 8:02
The real solution here is rm's answer. DumpSave gets suggested much too often on this site when it's really cumbersome, exactly for the reason you describe. Don't use DumpSave unless you really need to. Just use Export instead. –  Szabolcs May 11 at 13:58

I think you can use Names["Global*"] to get the name:

a = RandomReal[{0, 1}, 10];
SetDirectory[$TemporaryDirectory]; DumpSave["1.mx", a]; Quit[] SetDirectory[$TemporaryDirectory];
<< 1.mx
Names["Global*"]

(*{"a"}*)
-
Hey great! I can now see that my matrix was called uAll. How could I have forgotten that? Thanks xslittlegrass. –  bill s May 11 at 5:31