home *** CD-ROM | disk | FTP | other *** search
- ***************************************************************
- * StripANSI Docs v1.2 *
- * *
- * Program and Documentation Written by Syd L. Bolton *
- * *
- * ©1991,92 Legendary Design Technologies Inc. *
- ***************************************************************
-
- SUMMARY - WHAT's NEW IN 1.2
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- V1.2 includes the following new features/additions:
-
- a) I received a letter from Robert Gould, who asked
- if StripANSI could not just strip codes - but convert
- them to standard ASCII. Well, there's really only
- one that would work, and that's INSERT {N} CHARS. Now,
- under the new "SPECIAL" menu, if you have this conversion
- turned on, a file that had the code (for example) to
- "INSERT 5 CHARACTERS", it would be replaced with 5
- spaces in the output file. NOTE this is NOT 100% ANSI
- compatible, but should work in many cases (I believe
- Robert wanted to line up columns of numbers).
-
- b) While I was at it, I thought I might as well add an
- option to convert TABS (ASCII 9) to actual SPACES.
- The default is 8 spaces, but I've added a little
- requester to let you change that.
-
- c) Perhaps it might even be useful to CONDENSE a file
- (go the other way - convert spaces into tabs... just
- a thought)
-
- d) The help option now has another page to accomodate
- the new features.
-
- e) PROGRAMMING NOTES:
- I've documented the new features a little
- better in case you want to add your own
- conversions in the future.
-
- NOTE: Although the CLI version indicates 1.2, it DOES NOT
- do the above features. It's a little hard to
- implement with so many command line switches. I've
- changed the version number in the program only to
- be consistent with the rest of the package.
-
- SUMMARY - WHAT's NEW IN 1.1
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- V1.1 includes the following new features/additions:
-
- a) Additional codes now stripped. These include the
- bell character (ASCII 7), and many others that
- aren't true ANSI codes but can be found in many
- files.
-
- b) The Workbench version now contains on-line help.
- Here you will find a list of the new codes and
- their ASCII values. Press HELP or use the menu.
-
- c) The CLI version includes a new switch called "TRUE".
- When this is turned on, only true ANSI codes are
- stripped. Things like BELL's, BACKSPACES, and what
- not are left alone.
-
- d) PROGRAMMING NOTES:
- CLI VERSION: i) source changed to make it easier
- to add new codes (called extended)
- ii) re-compiled with Manx 5.2a
-
- WORKBENCH VERSION: i) gadgets code re-written into an
- array (as mentioned in 1.0).
- ii) report format changed to allow
- for more codes in the future.
- iii) re-compiled with Manx 5.2a
-
- 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 Two Flavours of StripANSI
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- StripANSI actually comes in two (2) 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,TRUE]
-
- 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. 'TRUE' is a new
- feature to V1.1, and allows you to specify that ONLY ANSI codes are
- removed, and NOT things like FORM FEEDS, CARRIAGE RETURNS, BELLS, etc.
-
- 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'.
- In the latest release, V1.1, you have some new codes added that
- the program will strip. Most of these are control codes that many dot-
- matrix printers support, and I have added their removal at the request
- of Robert Bromley from British Columbia. Their codes are listed in the
- "OTHER CODES" section of the screen, and their actual ASCII values can
- be obtained by selecting HELP (another new feature, accessible by either
- selecting help from the menu, or pressing the HELP key on the keyboard).
- Another new feature is called "INVERT" which will invert the status
- of all of the gadgets on the screen. NOTE: Due to a bug in the operating
- system, clicking on this gadget repeatedly will cause the appearance of the
- gadgets to be incorrect - they will still function as you would expect and
- clicking on it several more times will correct the problem. Coding wise,
- there are ways around this but they were too cumbersome to include at this
- point in time, and the problem exists both in 1.2/1.3 and 2.0.
-
- ARP VERSION
- -----------
- Originally, I had planned an ARP version as well. Since the
- Workbench version is small enough, I have abolished this idea.
-
- 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. NOTE: In v1.1, it will also strip
- various other codes, including the BELL (ASCII:7) and others. For a
- complete list, ask for HELP in the program.
-
- 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 voicemail/fax - extension 5
- (519)-754-1205 Probe BBS: Sysop: A.Antoszewski 24hrs, 2400, 8n1
-