Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

recovering corrupted notebook (Re: Please Help)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19293] recovering corrupted notebook (Re: Please Help)
  • From: paulh at wolfram.com (P.J. Hinton)
  • Date: Sat, 14 Aug 1999 01:45:17 -0400
  • Organization: "Wolfram Research, Inc."
  • References: <7p00cv$755@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <7p00cv$755 at smc.vnet.net>, "schatzi" <antoine.zahnd at iprolink.ch> writes:

>Please Help !!!
>
> Now it is a 36k notebook I wrote several weeks ago with a lot of 
> procedures that I would prefer not to rewrite.  Moreover the notebook 
> is to generate a package itself needed by others notebooks. (I am so 
> sad)
>
> Does the description of my problem sounds familiar to somebody?
>
> Is it possible to "recover" the notebook? (please say YES)

I am not certain how you managed to corrupt your notebook.  From
your subsequent posting, it appears that somehow the notebook's
contents have been interpreted and stored as a single string,
and then the notebook has been written out with every instance
of a backslash character (\) being escaped out in the string.
If you were to look at the notebook in a plain text editor, you
would probably see that it looks like this:

(***************************************************************

		Mathematica 3.0 Compatible notebook

			<snip>

Notebook[{
  Cell[
   TextData["Notebook[{Cell[BoxData[\\(2\\ + \\ 2\\), \"Input\"

			<snip>


You will need to get your hands on a text editing program that
has good support for regular expression search and replacement
facility.  You will have to remove the outer Notebook[] expression
wrapper and removing the the string delimiters in the cell contents.
Then you'll want to do a global search and replace, changing the 
double backslashes to single backslashes.  

At that point, there is a good chance that you might be able to
use the corrupt notebook recovery utility on the Technical Support
website:

http://support.wolfram.com/FrontEnds/Notebooks/Files/FixingCorrupted.html

The instructions for using this utility can be found on that webpage.

To avoid crises like this in the future, you may want to do the following:

1) Back up your files on a basis that is sufficiently frequent so that
you do not lose too much work if your original file gets damaged.  This
is not just true for Mathematica, but for _any_ application that saves
its data to a file in a format that must be reinterpreted by the 
application.

2) Force the front end to save notebooks without using the linear
syntax for box structures.  This can be done on a global basis 
for the front end by evaluating this expression in a notebook:

        SetOptions[$FrontEnd, 
          PrivateNotebookOptions -> 
            {"ShortBoxForm" -> False}]

You can also set this option in the front end Option Inspector
dialog by changing the option value while the scope indicator
is ste to "global".

--
P.J. Hinton
Mathematica Programming Group           paulh at wolfram.com
Wolfram Research, Inc.
Disclaimer: Opinions expressed herein are those of the author alone.


  • Prev by Date: Re: circumference of an ellipse
  • Next by Date: Re: PolynomialQ (wrong) behavior ?
  • Previous by thread: precision of floating-point-numbers
  • Next by thread: cell group closure and dingbats (was: What I try to ask is ...)