The Mudcat Café TM
Thread #156795   Message #3698988
Posted By: Jack Campin
01-Apr-15 - 07:14 PM
Thread Name: Tech: blickie/bold/italic/colour generator 4 U
Subject: RE: Tech: blickie/bold/italic/colour generator 4 U
Doing this in the Unix shell (Terminal in MacOS):

echo "<tt>"
sed "s/ /\&nbsp;/g
s/$/<br>/" $1
echo "</tt>"

Put those four lines in a shell script.

Make it executable.

Invoke it on a file of ABC code.

I just tested it on a file containing the following (and
which looks exactly like this in BarFly's text edit panel):

X:2
T:Stick the Minister
M:C|
L:1/8
K:Amin
c   |A/c/d dd e2 de |f>gTe>d g/f/e/d/ ce   |d/d/d dd       e2 ed/e/   |ff g/f/e/d/ T^c>BA:|
f/g/|a>ba>f   g>ag>e|f>gf>d  g/f/e/d/ cf/g/|aa    b/a/g/f/ gg a/g/f/e/|ff g/f/e/d/ T^c>BA:|

Paste into a Mudcat thread with automatic linebreaks off (and preview
on, since any non-ABC in the message will need linebreaks).

The HTML generated by that script looks horrendous.
Don't read it, just paste it.