[Date Index] [Thread Index] [Author Index]
Re: Saving data with notebook
On 8/17/10 at 1:21 AM, kent.vandervelden at gmail.com (Kent A. Vander Velden) wrote: >My routine is typically to Import data into Mathematica (often >multiple files), perform some manipulation, and plot the results. >I'd like to be able to use the Mathematica notebook as the archive >of the raw data, analysis, and results. To do this, I'd like to save >the contents of some if not all the variables associated with a >notebook, preferably into the notebook. I've searched for methods to >do this and the only thing I've found is to print the contents of >variable and reformat this to form an assignment that can be save >with the notebook. This is not so great in my case as often the >input data is several 100 megabytes. I suspect this is a common need >and I'm curious how other handle it. I'm probably overlooking an >obvious option. Take a look at DumpSave. Doing DumpSave["file.mx", "Global`"] will write out all of your data and variables in the Global` context to a binary file that can be re-loaded using Get. There are a few things this will not preserve. It will not save and restore the history stack. Nor will it re-open any file streams that are open when DumpSave is executed. It is also important to realize the format used by DumpSave is not portable from one computer system to another.