Linux command
unrtf 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Example
unrtf --html [document.rtf] > [document.html]
Example
unrtf --text [document.rtf] > [document.txt]
Example
unrtf --latex [document.rtf] > [document.tex]
Example
unrtf --nopict --html [document.rtf] > [document.html]
Example
unrtf --verbose --html [document.rtf]
Example
cat [document.rtf] | unrtf --text
说明
unrtf is a GNU command-line converter that transforms documents in Rich Text Format (RTF) into other formats including HTML, plain text, LaTeX, and VT100-escaped text. It supports tables, fonts, hyperlinks, paragraph alignment, foreground and background colors. Embedded images are extracted as separate files unless disabled with --nopict. If no file is specified, unrtf reads from standard input. Output is written to standard output. Since version 0.21.0, all codepage conversion is done through the iconv library and output control is managed through runtime configuration files, making it highly customizable.
参数
- --html
- Select HTML output (default)
- --text
- Select plain ASCII text output
- --vt
- Select text output with VT100 terminal escape codes
- --latex
- Select LaTeX document output
- --rtf
- Select RTF output (typically more compact than input)
- --nopict
- Disable extraction of embedded pictures to the current directory
- --noremap
- Disable charset conversion (only works for 8-bit character sets)
- --verbose
- Print additional processing information
- --quiet
- Suppress leading comments in the output
- -t _tags_file_
- Specify an output configuration file to use
- -P _config_search_path_
- Specify directories (colon-separated) to search for configuration files. Defaults to /usr/share/unrtf/
- --version
- Print program version
- --help
- Display help information
FAQ
What is the unrtf command used for?
unrtf is a GNU command-line converter that transforms documents in Rich Text Format (RTF) into other formats including HTML, plain text, LaTeX, and VT100-escaped text. It supports tables, fonts, hyperlinks, paragraph alignment, foreground and background colors. Embedded images are extracted as separate files unless disabled with --nopict. If no file is specified, unrtf reads from standard input. Output is written to standard output. Since version 0.21.0, all codepage conversion is done through the iconv library and output control is managed through runtime configuration files, making it highly customizable.
How do I run a basic unrtf example?
Run `unrtf --html [document.rtf] > [document.html]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --html do in unrtf?
Select HTML output (default)