Ansifilter Dokumentation
Ansifilter Handbuch
Wenn man Logdateien von einem Linux oder Unix-System liest findet man öfter folgendes:
Dieser Text enthält ANSI Codes, die in einem Terminal-Emulator ausgewertet werden und für eine Formatierung des Texts sorgen. Was in einem Terminal schön aussieht, hilft in einem Windows-Editor nicht unbedingt weiter. Es kann auch vorkommen, dass die eingestellte Farbausgabe auf einem aktuellen Desktop nicht leserlich ist. Man kann nicht alle Probleme mit Cygwin lösen, daher gibt es ansifilter:
Diese Screenshots zeigen die Windows- und Linux- Versionen der GUI, die eine Datei mit ANSI-Sequenzen anzeigen.
Ansifilter entfernt ANSI Codes oder konvertiert sie in farbige HTML, TeX, LaTeX, RTF oder BBCode Dateien.
Das Progamm gibt es auch als Kommandozeilenversion:
ansifilter ansifile.txt ergibt:
Several ANSI codes: Bold Underline Black Red Green Red Background Green Background Image inverted and back
ansifilter --html ansifile.txt ergibt:
Several ANSI codes: Bold Underline Black Red Green Red Background Green Background Image inverted and back
Funktionen
Dies sind die Optionen der Kommandozeilenversion:
File handling:
-i, --input=<file> name of single input file
-o, --output=<file> name of single 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 text formats:
-T, --text (default) Output text
-H, --html Output HTML
-L, --latex Output LaTeX
-P, --tex Output Plain TeX
-R, --rtf Output RTF
-B, --bbcode Output BBCode
Formatted text options:
-d, --doc-title Set HTML/LaTeX document title
-e, --encoding Set HTML encoding (must match input file encoding)
-f, --fragment Omit HTML header and footer
-F, --font=<font> Set HTML/RTF font face
-r, --style-ref=<rf> Set HTML/TeX/LaTeX stylesheet path
-s, --font-size<fs> Set HTML/RTF font size
-p, --plain Ignore ANSI formatting information
Other options:
-h, --help Print help
-v, --version Print version and license info
Examples:
ansifilter -i text_with_ansi.txt -o text_without_ansi.txt
ansifilter *.txt
tail -f server.log | ansifilter
Der GUI kann als erster Parameter eine Eingabedatei übergeben werden.
Unterstützte ANSI-Sequenzen
Formatierung:
Bold, Underline, Italic, Blink
Farben:
Black, Red, Green, Yellow, Blue, Magenta, Cyan, White, xterm 256 color codes
Andere:
Conceal/Reveal, Image positive/negative
