Created
July 22, 2011 13:52
-
-
Save mjf/1099492 to your computer and use it in GitHub Desktop.
Transform ASCII-art tables into XTerm-art tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sed -f | |
# Transform ASCII-art tables into XTerm-art tables | |
# Copyright (C) 2011 Matous J. Fialka, <http://mjf.cz/> | |
# Released under the terms of The MIT License | |
# Horizontal and vertical line crossing | |
s/-|-/-^[(0^On^[(B-/g | |
# Top side and vertical line crossing | |
s/-\.-/-^[(0^Ow^[(B-/g | |
# Bottom side and vertical line crossing | |
s/-'-/-^[(0^Ov^[(B-/g | |
# Top left corner and right side crossing | |
s/\.|/^[(0^Olu^[(B/g | |
# Top right corner and left side crossing | |
s/|\./^[(0^Otk^[(B/g | |
# Bottom right corner and left side crossing | |
s/|'/^[(0^Otj^[(B/g | |
# Bottom left corner and right side crossing | |
s/'|/^[(0^Omu^[(B/g | |
# Left side and horizontal line crossing | |
s/|-/^[(0^Ot^[(B-/g | |
# Right side and horizontal line crossing | |
s/-|/-^[(0^Ou^[(B/g | |
# Top left corner | |
s/\.-/^[(0^Ol^[(B-/g | |
# Top right corner | |
s/-\./-^[(0^Ok^[(B/g | |
# Bottom right corner | |
s/-'/-^[(0^Oj^[(B/g | |
# Bottom left corner | |
s/'-/^[(0^Om^[(B-/g | |
# Horizontal line | |
s/-/^[(0^Oq^[(B/g | |
# Vertical line | |
s/|/^[(0^Ox^[(B/g | |
# Fill character | |
s/#/^[(0^Oa^[(B/g | |
# Circle | |
s/\*/^[(0^Of^[(B/g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace all
^O
toCtrl-V Ctrl-O
and all^[
toControl-V Escape
. Then use as follows:Example
test.art
:AFAIK works in
xterm(1)
only.