How to repair a damaged .doc (word) file

5,394

You might be able to salvage some of the text. Try running this command in a terminal:

strings foo.doc > output.txt

Then open output.txt in a text editor to see the results. (Note that this particular command will only work with .doc files, and not the newer .docx format.)

To filter only strings of at least ten characters:

strings -n10 foo.doc > output.txt
Share:
5,394

Related videos on Youtube

kjetil b halvorsen
Author by

kjetil b halvorsen

Mathematical statistician For contact, my email: <first name><My public seed> at gmail dot com Below a list of some questions I have responded to, where I consider my response interesting: how-does-saddlepoint-approximation-work what is the intuition behind svd goodness of fit and which model to choose linear regression or poisson Estimating parameters for Binomial with both $n$ and $p$ unknown what is the difference between finite and infinite variance general sum of gamma distributions why should we use t errors instead of normal errors maximum likelihood estimation mle in layman terms difference of two iid lognormal random variables non transitivity of correlation correlations between gender and brain size Intuitio on the Kullback-Leibler divergence Taleb and the black swan Correlations between continuous and categorical nominal variables Why does logistic regression become unstable when classes are well separated

Updated on September 18, 2022

Comments

  • kjetil b halvorsen
    kjetil b halvorsen almost 2 years

    (This is Lubuntu 13.04)

    I have a damaged .doc (word) file, made with abiword. The power went off, and damaged the file. I tried reading it in libreoffice as well. Any advice on how repairing this file on Ubuntu?

    • kjetil b halvorsen
      kjetil b halvorsen about 11 years
      This is what libreoffice says: File format error found at 151,163 (row, col). Now file recovery dialog opens!
    • haneefmubarak
      haneefmubarak about 11 years
      Did you try using the recovery dialog?
  • Admin
    Admin over 9 years
    strings foo.doc > bar.doc to output all in a doc. askubuntu.com/a/589399/47206. less may not be good when a lot of useful text recovered is separated into short lines of 5-6 characters
  • Admin
    Admin about 9 years
    @cipricus: Good point, thanks! I've updated the answer for future visitors.
  • 777Anon
    777Anon over 5 years
    But the files are zip compressed.. i think its better to remove the compression first...
  • Admin
    Admin over 5 years
    @777Anon: As I mentioned, this question is about .doc files, which are not compressed. The newer .docx files are compressed XML which can probably be read in a text editor without strings.