1

So I, being dumb, decided to open my history essay in emacs and tried to edit a word. So I removed a letter from my introduction, and I saved it. The next time I opened the file in word, it said my file was corrupted and I had to repair it, so I clicked the repair button. Now MS Word is not responding, and I can only see a draft in spotlight that I had previously saved yesterday night.

Is there any way to expedite the process of "recovering" the word file, given that I only changed one letter in the main document xml file?

I realize that there are many answers regarding corrupted microsoft word files. My question is specifically about files that were not "corrupted", just externally changed but that are still perfectly valid.

5
  • 2
    Can you open it back in emacs and copy-paste the whole thing to Word? You will lose all formatting of course - but as a first step - just secure the information before it becomes "un-openable" from emacs too
    – Prasanna
    Nov 21, 2014 at 5:05
  • @Prasanna Thanks for the suggestion! Unfortunately, the xml file is filled with formatting tags such as font and color, so it is nearly impossible to decipher the encoded text from emacs. Nov 21, 2014 at 5:33
  • 2
    Blew the xml tag structure? Run a copy through xmllint to see. Also, take a copy and use a programming editor with regex replace functions to strip the xml tags so you can recover the text. Nov 21, 2014 at 6:06
  • Did you write your essay on a laptop? Mac laptops generally have a backup system that works like Time Machine but is stored on the laptop's own hard disk, which keeps copies of things. You might be able to find it in the Time Machine GUI even if the good copy of the document didn't get saved on an external Time Machine volume. (There are also "versions" of documents stored each time you save, but I think that only applies to applications specifically written to that API; I doubt Emacs is included.) Nov 21, 2014 at 19:18
  • Yes. I did. In fact, I recovered and handed in the essay earlier this morning. Thanks for all of your help. :) Nov 21, 2014 at 21:58

1 Answer 1

1

use the command xmlint to open the file and then using any of the program editors like notepad++,Sublime Text, atom,etc add the letter which you removed using regular expression function available in all the editors. You should be able to get the good copy of file now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .