s/ */|/g :1 s/\(.\)|\1/\1 \1/ t1 x 1g G : s/\(.\)\(.*\)\n\(.\)/\2=\1\3\n/ s/=\([^|]\)\1/ / s/=\w./-/ s/=../|/ s/- /--/ s/-|/-+/ s/|-/+-/ 1y/ /-/ t P g $p $y/OX |/---+/
Note that non-ascii characters in the above source code will be escaped (such as \x9f).