Message Boards Message Boards

0
|
18574 Views
|
5 Replies
|
4 Total Likes
View groups...
Share
Share this post:

File corrupted

Posted 11 years ago
 I had a very important file corrupted. Please can someone help me. I'm Mathematica User many years and never had this problem. And now happened to a very important file. I am sending the attached file, you guys can fix it?
Attachments:
POSTED BY: Cleuzir da Luz
5 Replies
Attachments:
POSTED BY: Jesse Friedman

Slightly relates as it has to do with keeping backups of your work, and there have been several discussion recently about corruption and backups, take a look at this tool that I recently posted on: http://community.wolfram.com/groups/-/m/t/320808

POSTED BY: David Reiss
Tech Support recommends making a copy of the damaged file and working with the copy.

The second method Sean shows is the newer and usually (but not always) better code for this.
POSTED BY: Bruce Miller
Please see this article on repairing corrupted notebooks. 

http://support.wolfram.com/kb/3300

If this doesn't work try to evaluate the following code:
 RecreateNotebook[fileName_String]:=      
 Module[{nb=NotebookCreate[],strm=OpenRead[fileName,BinaryFormat->True],result,cell,tmpChar,beginPos,endPos},
 While[(result=Find[strm,{"Cell[\"","Cell[BoxData[","Cell[TextData["}])=!=EndOfFile,    
 beginPos=SetStreamPosition[strm,StreamPosition-StringLength[result]];
 Quiet[cell=Check[Read[strm,Expression],tmpChar=" ";endPos=StreamPosition;
 While[tmpChar=!=","&&endPos>beginPos+1,SetStreamPosition[strm,--endPos];
 tmpChar=Read[strm,Character]]; If[endPos>beginPos,SetStreamPosition[strm,beginPos];
 ToExpression@StringJoin@ReadList[strm,Character,endPos-beginPos],$Failed]]];
 If[Head[cell]===Cell,NotebookWrite[nb,cell,After]];];Close;]

Then run the function RecreateNotebook on the file path to the corrupted file. 
You can use Insert > FilePath... to insert the file path into the notebook. 

If you still see any issues, contact Wolfram Technical Support at support@wolfram.com with your name and license number or activation key. 
POSTED BY: Sean Clarke

The link: http://support.wolfram.com/kb/3300 appears to be out of date as there is no *RestoreNotebookAT[]function in AuthorTools in Mathematica 10. There is a RestoreNotebook[] function.

It appears my notebook and backup of my notebook on a separate drive are too far gone to benefit from the code for RecreateNotebook above.

POSTED BY: Doug Kimzey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract