1

So I was writing a paper on Microsoft Word and the file is corrupt now. I'm trying to see if I can open the file using vim, but it says it is binary. Is there any command or any way to convert it into text so that I can just vim myfile.doc and copy the text contents? I tried doing a cp myfile.doc myfile.txt to change the extension but it still says it's binary.

4

5 回答 5

1

A doc file is a proprietary format by Microsoft. Docx formats are xml based but neither can be read directly using a text editor. If your file is corrupt you're probably going to have a lot more luck try to find the autosave location or try and recover the document using the tool office provides. In future remember to back up your work ;)

于 2013-03-30T16:39:24.900 回答
1

/usr/bin/strings may be helpful -- built-in to OS X. Hope you can recover your paper.

于 2013-03-30T16:42:37.620 回答
0

You might try using Antiword to convert to .txt if it can still access the file properly.

http://en.wikipedia.org/wiki/Antiword

于 2013-03-30T16:38:22.503 回答
0

.doc or .docx is not a plane txt file. It has several formatting and a bit of binary and in .docx xml factor included.

You can go for OpenOffice which is Free.

于 2013-03-30T16:38:58.243 回答
0

Word itself has an option to "Recover Text From Any File" which is worth trying if you haven't done so already. When you open the file in Word, if it doesn't recognise the format, you should see a conversion dialog and the option is in there. You might have to check the "Confirm conversion at open" option (e.g. "Word Preferences->General->Confirm conversion at open" on Mac Word 2011, "File->Options->Advanced->General->Confirm file format conversion on open" on Windows Word 2010.

于 2013-04-01T08:51:08.660 回答