Scroll to navigation

ansifilter(1) user documentation ansifilter(1)

NAME

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

Name of input file
Name of output file
Name of output directory
Continue reading after end-of-file (like tail -f). Use system tail if available.
Set maximum input file size (examples: 512M, 1G; default: 256M)

Output formats

Output text (default)
Output HTML
Output Pango markup
Output LaTeX
Output Plain TeX
Output RTF
Output BBCode
Output SVG

Format options

Add HTML line anchors (opt: self referencing, assumes -l)
Set HTML/LaTeX/SVG document title
Omit HTML header and footer
Set HTML/RTF/SVG font face
Do not adhere to clear (ESC K) commands (default: true)
Do not adhere to CSI commands (useful for UTF-8 input)
Print line numbers in output file
Read color mapping file (see README)
Set HTML/TeX/LaTeX/SVG stylesheet path
Set HTML/RTF/SVG font size
Set HTML encoding (must match input file encoding); omit encoding information if enc=NONE
Ignore ANSI formatting information
Wrap long lines
Omit default foreground color
Omit trailing newline
Omit version info comment
Omit line numbers of wrapped lines (assumes -l)
Output dynamic stylesheets (HTML/SVG)

ASCII art options

Parse codepage 437 ASCII art (HTML and RTF output)
Parse BIN/XBIN ASCII art (HTML output, no stdin)
Parse Tundra ANSI art (HTML output, no stdin)
Set ASCII art width (default 80)
Set ASCII art height (default 150)

OTHER OPTIONS

print help
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. The ANSI art file formats BIN, XBIN and TND cannot be read from stdin.

Examples

File conversions:

ansifilter -i text_with_ansi.txt -o text_without_ansi.txt

tail -f server.log | ansifilter

ansifilter *.txt

AUTHORS

Andre Simon <a.simon@mailbox.org>

SEE ALSO

More information at http://www.andre-simon.de/.

2023-01-08 Andre Simon