Re: Corruption of file

*To*: mathgroup at smc.vnet.net*Subject*: [mg129153] Re: Corruption of file*From*: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>*Date*: Tue, 18 Dec 2012 02:39:56 -0500 (EST)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-newout@smc.vnet.net*Delivered-to*: mathgroup-newsend@smc.vnet.net

Dear David, dear John, dear Helen, Yes this file is very valuable. In fact it is one of the files, where I collect tips and tricks on Mathematica learned from others or invented by myself, but those that I have at least once successfully tried. It enormously accelerates my work. And for this reason, yes, I made a backup rather recently, so I have not lost a lot. I had already such an event once, few years ago and then I lost alot of valuable information: a lecture prepared during several days. David, none of the scenarios proposed in your mail was the case. Just in a fresh notebook I made a cell with a simple code illustrating the new way of the use of LineLegends and Placed statements in M9 like this: Plot[{t*Exp[-t], Sin[t^2]}, {t, 0, 2 \[Pi]}, PlotStyle -> {Red, Blue}, PlotLegends -> Placed[LineLegend[{Red, Blue}, {"exp", "sin"}, LegendLayout -> "Column"], Scaled[{0.15, 0.2}]]] and evaluated it successfully. Then I copy-pasted this cell into another notebook, the one in question. This time it was a very large notebook, where I made a separate cell for this example. I also inserted two comments of the form (* a comment *) like this: Plot[{t*Exp[-t], Sin[t^2]}, {t, 0, 2 \[Pi]}, PlotStyle -> {Red, Blue}, (* the Legend starts here *) PlotLegends -> Placed[LineLegend[{Red, Blue}, {"exp", "sin"}, LegendLayout -> "Column"], Scaled[{0.15, 0.2}]] (* The Legend ends here*) ] and again evaluated it, this time in the large notebook. In the process of this second evaluation I have got the message described below, and the notebook got corrupted. First I thought that this may be the comment problem (as described by Fred Simons few days earlier). For this reason I tried to make the same code with comments in another (fresh) notebook and evaluate it. It evaluated successfully. I tried the way proposed by Helen Read (see below), it did not work in M9. I tried to open the file by the Notepad and cut away the mentioned piece of the text: bdnhsNoXjUtzE3OjHyBhBxTcduHehni+. It did not help. I tried to find and cut away the whole new cell, but did not really succeeded to find where the cell starts and stops. The more that I am not sure that the corrupted part is in that cell. John, I tried to send you the file, but the server rejected my mail saying that your address does not exist. I will try again later. My question is not that much about how to open just this file. It is more general: what could be done in such a case? Just in case it will start happening. Best, Alexei On 11/12/2012 07:24, Alexei Boulbitch wrote: > Dear community, > > During the work evaluation a cell I got the message: > > "There is a syntax error in the file being read. Do you want to open it as > a plain text?" > > Upon pressing "Yes" I got the message: > > "There was a syntax error on line 541095 in the file: 2Dgraphics.nb. > The error was: > > bdnhsNoXjUtzE3OjHyBhBxTcduHehni+" > > And the question, if I wish to open it as a plain text file. Upon the pressing the "Yes" button the hang up starts. > > The file in question cannot be open by Mathematica any more. > > It is Mathematica 9 on Windows XP. > > Alexei BOULBITCH, Dr., habil. > IEE S.A. > ZAE Weiergewan, > 11, rue Edmond Reuter, > L-5326 Contern, LUXEMBOURG > > Office phone : +352-2454-2566 > Office fax: +352-2454-3566 > mobile phone: +49 151 52 40 66 44 > > e-mail: alexei.boulbitch at iee.lu<mailto:alexei.boulbitch at iee.lu> > Quite apart from the failure to open the file as plain text - which is not really that useful, because it will display BoxForm structures - there are surely two important questions: 1) Do you have any idea what caused the corruption? 2) Is the notebook important to you, and if so, is it backed up? Unless this is a bug in Mathematica 9, this sort of thing can happen if a notebook is written back to a disk just as the system is shut down (or a removable disk is pulled out). If you need the data that has been corrupted, you can probably retrieve most of it using a text editor on the file. Try opening an uncorrupted notebook with a text editor to see what they contain. David Bailey http://www.dbaileyconsultancy.co.uk I didn't notice your original post or I would have replied earlier, but I just saw David Bailey's response. I have some tools which are pretty good at cracking file corruption. If you send your notebook to me, I can try to recover it for you. John Fultz jfultz at wolfram.com User Interface Group Wolfram Research, Inc. The following sometimes works (I have not tried it in v. 9 however): In a new notebook: <<AuthorTools` NotebookRestore[] This will open a window for you to find and select the notebook you wish to restore. Good luck Helen Read University of Vermont Alexei BOULBITCH, Dr., habil. IEE S.A. ZAE Weiergewan, 11, rue Edmond Reuter, L-5326 Contern, LUXEMBOURG Office phone : +352-2454-2566 Office fax: +352-2454-3566 mobile phone: +49 151 52 40 66 44 e-mail: alexei.boulbitch at iee.lu