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

查看:274
本文介绍了如何从.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天全站免登陆