home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
602b.lha
/
StripANSI_v1.0
/
StripANSI.docs.pp
/
StripANSI.docs
Wrap
Text File
|
1992-02-06
|
5KB
|
105 lines
***************************************************************
* StripANSI Docs v1.0 *
* *
* Program and Documentation Written by Syd L. Bolton *
* *
* ©1991 Legendary Design Technologies Inc. *
***************************************************************
Introduction
~~~~~~~~~~~~
There are many times when capturing buffers from terminal
programs that you may find the pretty (but sometimes annoying) use of
ANSI codes to be undesireable. In one case, I wanted to keep my own
list of downloadable files from a certain BBS, but I wanted to weed
out the menus, and other messages. When loading my captured file into
my text editor, I was appalled to see the screen cluttered with ANSI
codes everywhere. Search & replace just won't do here, since there are
so many variations. So, a program needed to be written to remove these
codes for me. Here is that program.
The Three Flavours of StripANSI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StripANSI actually comes in three (3) different versions, each
of which has a particular use for you, depending upon your system.
They are:
CLI VERSION
-----------
This is the smallest version of the program, intended to be used
by people who don't like WIMP interfaces, but prefer command line ones.
The usage of the program is simply:
StripANSI inputname outputname [REPORT]
Of course, the 'inputname' is the name of the ANSI-ridden file,
'outputname' is the name of the destination filename for the NEW, stripped
file, and the optional 'REPORT' will generate a report about the number
of ANSI entries, and their appropriate percentages.
WORKBENCH VERSION
-----------------
This version of StripANSI has a full Intuition interface that allows
more control over the conversion. You have the ability to selectively turn
on and off certain types of conversions. The default is that ALL ANSI codes
listed on the screen are to be stripped. If you DON'T want one (or more) of
these codes stripped, click on its gadget to highlight it. There is also the
ability to selectively generate a report, and all file handling is done
through a file requester which makes the entire program 'point and click'.
ARP VERSION
-----------
This version is the same as the Workbench version but is smaller
because it uses the ARP library for the file requester. You will want
to use this version if you have (or intend to start using) the ARP
library on your system.
NOTE: WITH THIS RELEASE, THE ARP VERSION IS NOT FINISHED! I
REALLY NEED TO GET A HOLD OF SOME REAL ARP DOCUMENTATION!
How It Works
~~~~~~~~~~~~
StripANSI is a very simple program. A table of code names, and
their equivalent 'ending' indicators was created. When a CSI (Code
Sequence Introducer) character is encountered in the input file, the
program then searches the table to find a match for the 'ending'
indicators. When one is found, normal 'read in, write out' procedures
continue, until another CSI is encountered. By simply not writing the
characters found between (and including) the CSI and ending character,
we eliminate all ANSI codes in a file.
Currently, StripANSI will also eliminate any BACKSPACE (ASCII:8)
characters, which often appear in terminal buffers when a mistake is
made on the keyboard. It will also eliminate FORM FEEDs (ASCII:12) which
is often used to clear the screen.
True ANSI?
~~~~~~~~~~
Since I do not actually have a valid ANSI table of codes
(if someone can tell me where I can get a complete table, I would be
most appreciative), I have only filtered the codes that the Amiga
understands, as defined by the latest RKM, 'Libraries & Devices'.
StripANSI will also remove any Amiga-specific (non-ANSI) codes, and
these are preceeded by a '»' character to indicate they are NON-ANSI.
Conclusions
~~~~~~~~~~~
Please test this program with files you have to make sure
it works as it should, trying the report option as well. Please
realize the '%' indicators is not actually 100% accurate: this is
because I did not want to introduce floating-point numbers (as this
would increase program size unnecessarily) so the % will probably
only add up to 99%, but this is okay, and not really a bug.
Any problems, questions, or concerns should be directed to
me either via E-MAIL, mail, fax, or voice. THANKS FOR YOUR TIME!
Syd Bolton
President
Legendary Design Technologies Inc.
25 Frontenac Avenue
Brantford, Ontario
N3R 3B7
(519)-753-6120 voice/answering machine
(519)-754-4059 fax
(519)-754-1120 Probe BBS: Sysop: A.Antoszewski 24hrs, 2400, 8n1