如何从 .doc & 中提取纯文本.docx 文件? [英] How to extract just plain text from .doc & .docx files?

查看:36
本文介绍了如何从 .doc & 中提取纯文本.docx 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道他们可以推荐的任何东西,以便从 .doc.docx 中提取纯文本?

Anyone know of anything they can recommend in order to extract just the plain text from a .doc or .docx?

我找到了这个 - 想知道是否还有其他建议?

I've found this - wondered if there were any other suggestions?

推荐答案

如果你想要纯纯文本(我的要求)那么你只需要

If you want the pure plain text(my requirement) then all you need is

unzip -p some.docx word/document.xml | sed -e 's/<[^>]{1,}>//g; s/[^[:print:]]{1,}//g'

我在 命令行 fu

它解压缩 docx 文件并获取实际文档,然后去除所有 xml 标签.显然所有格式都丢失了.

It unzips the docx file and gets the actual document then strips all the xml tags. Obviously all formatting is lost.

这篇关于如何从 .doc &amp; 中提取纯文本.docx 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆