home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
asci2htm.zip
/
htm2asci.cmd
< prev
Wrap
OS/2 REXX Batch file
|
2002-09-27
|
2KB
|
62 lines
/* HTML to ASCII (852) converter */
'@echo off'
parse arg input output maradek
if input = '' | output = '' | maradek <> '' then
do
say 'HTML to ASCII (852) converter'
exit
end
'del 'output' >NUL 2>>&1'
accented_table = "á╡éÉí╓óαöÖΣσúΘüÜûΩ"
htmltag.1 = "á" /* á */
htmltag.2 = "Á" /* ╡ */
htmltag.3 = "é" /* é */
htmltag.4 = "É" /* É */
htmltag.5 = "í" /* í */
htmltag.6 = "Í" /* ╓ */
htmltag.7 = "ó" /* ó */
htmltag.8 = "Ó" /* α */
htmltag.9 = "ö" /* ö */
htmltag.10 = "Ö" /* Ö */
htmltag.11 = "ô" /* Σ */
htmltag.12 = "Ô" /* σ */
htmltag.13 = "ú" /* ú */
htmltag.14 = "Ú" /* Θ */
htmltag.15 = "ü" /* ü */
htmltag.16 = "Ü" /* Ü */
htmltag.17 = "û" /* û */
htmltag.18 = "Û" /* Ω */
do while lines(input)
line = linein(input)
do tag_num = 1 to 18
tag = htmltag.tag_num
do until tag_pos = 0
tag_pos = pos(tag,line)
if tag_pos <> 0 then
do
acc_char = substr(accented_table, tag_num, 1)
if tag_pos = 1 then
head = ''
else
head = left(line, tag_pos-1)
if tag_pos = length(line) - length(tag) + 1 then
tail = ''
else
tail = substr(line, tag_pos+length(tag))
line = head || acc_char || tail
end
end
end
rc = lineout(output, line)
end
rc = lineout(input)
rc = lineout(output)
exit