如何从损坏的 .docx 文件中提取数据?

Mat*_*w C 3 unzip word-documents

我女朋友的 .docx 文件已损坏,我正在尝试从中恢复文本。我了解到 .docx 本质上是一个 zip 文件,其中包含文件夹和一堆 .xml 文件(其中一个包含文档文本)。我在 Ubuntu 10.10 上按照以下命令解压缩存档:

unzip portfolio.docx -d file-dir
Run Code Online (Sandbox Code Playgroud)

我得到的结果是:

End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archieve.
unzip: cannot find zipfile directory in one of portfolio.docx or portfolio.docx.zip, and cannot find portfolio.docx.ZIP, period.
Run Code Online (Sandbox Code Playgroud)

在 Windows 8.1 上,我尝试了 WinZip、7zip、WinRar 和 Zip2Fix,但没有成功。

该文件重近 20Kb,因此我知道里面有一些内容。有什么办法可以强制解压吗?

Wil*_*ilf 5

运行这个:

cp portfolio.docx portfolio.zip
Run Code Online (Sandbox Code Playgroud)

或者只需重命名portfolio.docxportfolio.zip,您应该能够portfolio.zip使用存档管理器打开生成的文件并提取它们。

编辑:我刚刚进行了快速检查,这些文件可能位于word/document.xml或位于docProps/core.xml提取的文件夹中。

另一个编辑:如果生成的 zip 文件已损坏,请查看此处