Avi*_*vio 26 libreoffice text-processing
有没有一种办法cat或less只是作为一个的.odt文件antiword确实为.doc文件?
Rma*_*ano 35
解决方案是使用odt2txt. 现在,此命令由两个不同的软件包提供,即一个称为odt2txt您可以安装的软件包
sudo apt-get install odt2txt
Run Code Online (Sandbox Code Playgroud)
并通过包unoconv(还提供更多 libreoffice 格式之间的命令行转换),由
sudo apt-get install unoconv
Run Code Online (Sandbox Code Playgroud)
如果您有两者,则可以使用替代机制在它们之间切换:
sudo update-alternatives --config odt2txt
Run Code Online (Sandbox Code Playgroud)
如果您使用的odt2txt是odt2txt您刚刚使用的软件包提供的
odt2txt file.odt
Run Code Online (Sandbox Code Playgroud)
如果使用unoconv提供的包,你必须使用
odt2txt --stdout file.odt
Run Code Online (Sandbox Code Playgroud)
管道他们less有一个不太像的体验 ( odt2txt file.odt | less)
请注意,如果您不使用该--stdout选项,则 unoconv 提供的包会将结果写入名为 file.txt.
发行版建议的包似乎是来自odt2txt包的包(它在替代系统中具有更高的默认优先级);肯定它有更少的依赖。
您可以在没有任何特殊实用程序的情况下浏览文本。ODT 文件是重命名的 zip 存档。解压缩它,你会看到几个文件。其中之一,content.xml包含所有文本并且是more或less可读的。
odt2txt file.odt
源代码和 compilebale 工作 zip 可以在这里下载:
https://github.com/dstosberg/odt2txt/
或安装
sudo apt-get install odt2txt
| 归档时间: |
|
| 查看次数: |
3680 次 |
| 最近记录: |