ansifilter man page

Ansifilter — ANSI escape code processor and converter

Synopsis

ansifilter [d:i:F:m:o:r:s:e:fhptvHRT] [-i input file] [-o output file] [--text] [--html] [--latex] [--tex] [--rtf] [input files]

Description

Ansifilter is a small utility to handle text files containing ANSI terminal escape codes. The command sequences may be stripped or be interpreted to generate formatted output (HTML, LaTeX, TeX, RTF).

See the README file for details.

File options

-i, --input=<file>
name of input file
-o, --output=<file>
name of output file
-O, --outdir=<dir>
name of output directory
-t, --tail
Continue reading after end-of-file (like tail -f). Use system tail if available.

Output formats

-T, --text
Output text (default)
-H, --html
Output HTML
-M, --pango
Output Pango markup
-L, --latex
Output LaTeX
-P, --tex
Output Plain TeX
-R, --rtf
Output RTF
-B, --bbcode
Output BBCode

Format options

-a, --anchors
Add HTML line anchors (assumes -l)
-d, --doc-title
Set HTML/LaTeX document title
-f, --fragment
Omit HTML header and footer
-F, --font=<font>
Set HTML/RTF font face
-l, --line-numbers
Print line numbers in output file
-m, --map=<path>
Read color mapping file (see README)
-r, --style-ref=<rf>
Set HTML/TeX/LaTeX stylesheet path
-s, --font-size=<num?>
Set HTML/RTF font size
-e, --encoding=<enc>
Set HTML encoding (must match input file encoding); omit encoding information if enc=NONE
-p, --plain
Ignore ANSI formatting information
-w, --wrap=<len>
Wrap long lines
--wrap-no-numbers
Omit line numbers of wrapped lines (assumes -l)

ASCII art options

--art-cp437
parse codepage 437 ASCII art (HTML, RTF output only)
--art-bin
parse BIN/XBIN ASCII art (HTML, RTF output only)
--art-width
Set ASCII art width (default 80)
--art-height
Set ASCII art height (default 150)

Other Options

-h, --help
print help
-v, --version
print version and license info

If no in- or output files are specified, stdin and stdout will be used for in- or output. Plain text will be generated, if no output format is given. Parsing XBIN files overrides --art-width, --art-height and --map options.

Examples

File conversions:

ansifilter -i text_with_ansi.txt -o text_without_ansi.txt

tail -f server.log | ansifilter

ansifilter *.txt

Authors

Andre Simon <andre.simon1@gmx.de>

See Also

README file and webpage at http://www.andre-simon.de/ and http://wiki.andre-simon.de.

Info

2016-07-18 Andre Simon user documentation