
                             Text Modifier V3.1

                             by John Augustine

 TM (Text Modifier) was written in assembly for Ms Dos systems.  Requires
color graphics CGA or better. Does not need a lot of memory, and no
installation required.

  WINDOWS 3.1/95/98:

  No installation is required.  Simply copy "TM.EXE" into a directory
(folder) of your choice (example: "UTILS").  Click on "Start" (Windows 3.1,
"File") and "Run".  Type (example): "C:\UTILS\TM" and press Enter or click
"Ok" to launch TM.

  PLEASE NOTE:

  This is NOT a "free" program. See "CONCLUSION" near the end of this document
for details on making a small "donation" and becoming a "donor".

  Please read, "IMPROVE.TXT" (use "VIEW-DOC.EXE") for improvement information.

  PURPOSE:

 There are times when you would like to automatically modify a document/s,
which is too much trouble to do manually using a word processor or text
editor.  TM to the "rescue".

 TM creates another text file/s, or prints a text file with or without
modifications. The original input text file/s is never altered.

  Some optional TM features are:

 1. A "stripper" which can remove parts of every line.
 2. Replace all non-text (except CR,LF) characters with spaces.
 3. Convert all letters to upper or lower case.
 4. View "long line" (more than 80 characters long) documents by wrapping
    (not word wrap) at the 80th column.
 5. Reformat large documents for printing more efficiently.  In some cases,
    using only 1/3 the amount of paper!

 6. "Modify" text as follows:

  1.1 Remove a specified number of spaces from the beginning of every line.
  1.2 Remove a specified number of spaces from the end of every line.
      Note: 1.1 and 1.2 removes the specified number of spaces or less. The
      user specified amount is actually the maximum limit.
  1.3 Remove a specified sequence of spaces (lower amounts are ignored)
      anywhere in text.
  2.  Reduce a character/s or pattern sequence to a specified amount.
  3.  Remove a character/s or pattern sequence.
  4.  Replace a character/s or pattern sequence with another.
  5.  Keep (extract) lines from a document that contain a specified pattern.
  6.  Keep all lines except (exclude) lines that contain a specified pattern.
  7.  Other modify options:
  7.1 Clip a portion/s of a text file. Uses line number (user input) counter
      reference.
  7.2 Reformat and/or add CRs (+LFs) to a text file.

  Note: 2,4,5,and 6 have three categories of character patterns while 3 has
four categories:

  A. Case sensitive.
  B. Case insensitive.
  C. Numbers (decimal) which can represent non-text characters eg.
     control characters. Example 13 = carriage return, 10 = line feed, etc.

  Note: "Modify" 3 (remove ....) also has the option to remove everything
  between two specified patterns including the two patterns.

  When I refer to CR (carriage return), it should be understood that it
usually is accompanied by a LF (line feed). When I use "modifications" (in
quotes), I am referring to the procedures relative to "modify parameters".
These are not the only procedures that actually modify a file by TM. Consider
them as the main modification procedures.

  Examples of TM's usefulness:

  Note: Examples 1, 2, 3 relate to a list of program files (files available at
a BBS or FTP site)

 1. To see (via "View...") only 1997 files in the list.  Select "Modify"
option number 5 and enter /97 for the pattern. Select "View..." in main menu.
Don't confuse this with text editor's search.  TM will display a screen full
(view many at one time), instead of one at a time, as in a text editor's
search.  Note: This will not show you additional lines of information for each
file, if your list contains them.

 2. To create a file (list) of only JPG files, select modify option number 5
and enter case sensitive pattern ".JPG".  Only lines with that pattern will go
into the new file you are creating.

 3. Removing unnecessary lines from the file using "Modify" 6:

  Enter case sensitive "DL time" for the pattern.  Check results with the
"View...." and you should see all lines, except those which contain download
information.  I'm assuming that it is a separate line.  Just look for
something unique in lines you don't want.

 4. Just about all text editors and word processors can replace one pattern
with another.  Can they replace control characters eg. CRs?, add LFs (line
feed) to a document that doesn't have any?  Add two CRs,LFs in place of one
for double space printing?  Modify other non-text or control characters?  TM
can.  Here is an example for using TM's "modify" option number 4 to add LFs to
a document that contain only CRs:

 Select number 3. Enter the decimal number 13 (CR) and press enter. Next
enter decimal number 13,10 (10 is LF) for the "replacement" pattern and press
enter. All CRs will be replaced by CRs and LFs.

 5. Reformating a "long line" text file such as .WRI files so you can edit the
file in a Dos based text editor.  Use "modify" option number 7.2 (press 7, then
select number 2). Enter 79 for up to 79 characters per line with word wrap.

 Tip: In some cases, if you have a large document which does not display a
"list" anywhere, you can reformat ("Modify" 7.2) the document for very
compressed printing, say 200 or more characters per line (with word wrap).
Talk about saving paper.

 6. With a new feature (v2.7) added to "Modify 3", you can convert some forms
of text files such as Hypertext to a regular ascii text file by removing the
embedded parameters.  Example: "<font size =+3...>".  for the left (start)
pattern, I entered (without quotes) "<" and the right (end) pattern, I entered
">".  Everything between the "<" and ">" was removed including "<>".  I
created a regular ascii text file that I can easily read with any ascii text
viewer.

 7. With an enhanced (v2.7) "modify 2", I can reduce a sequence of CR,LFs.  I
received a document that contained many blank lines separating paragraphs.  I
wanted one blank line between each paragraph.  I entered for "modify" 2.3,
13,10 for the pattern and selected a sequence of 2 which sets the maximum
consecutive sequence of 13,10 to two (example: 13,10,13,10).  Note: The first
"13,10" is the end of the last line in a paragraph and the second "13,10"
creates the blank line.

 8. Printing a very large document (example: program instructions):

 Many program instructions are very large.  In some of them, all lines are
indented 10 (some more, some less) spaces.  I used TM and viewed the document.
TM has a scale and I used that to see how many spaces before the text starts.
I selected "Modify" 1 for space removal and selected 1 to remove spaces from
the beginning of each line and entered 9, which leaves 1 space at the
beginning of each "regular" line, used to separate the last word of the
previous line from the first word on the next line.  I returned to main menu
and toggled back page printing to on.  I selected "print a text file".  I
selected 2, "toggle preserve carriage returns" to off. I selected 3, "toggle
compress mode (132 characters per line)" to on.  Note: When you press 2 or 3,
you will see a message with useful information. I printed the document using a
little more than 1/3 the amount of paper it normally would take.

 When I toggled compress mode on, and preserve carriage returns off, words
from the next line are added to make longer lines with word wrap. Even with
this set to off, lines in which text starts 2 or more spaces from the
beginning will have their CR (carriage returns) preserved, as well as lines
with only a CR (used for creating blank lines between paragraphs).

 Here is an example of why there are exceptions in the procedure that is
"told" not to preserve CRs.

  This is a part of instructions for a utility program:

 <CR>
  A. Format a disk<CR>
  B. Delete a file<CR>
  C. Rename a file<CR>
  D. Etc....

 The first CR was used to create a blank line. We would not want to remove
that. The "list" of commands would end up in a line rather than in a column if
this condition was overlooked. Remember, it is important that any "list" of
commands, etc., be indented (usually is) at least two spaces in the document,
when you turn off preserve CRs.

 It is important therefore to look at the text first. Use "Read a text file"
so you can see the file in it's original form (unless "long line" text).  Try
out different settings if you are not sure of the outcome.  Use "View a text
file" to see the results before you print the file or create another file.
Note: Original file is never altered.

 Note: "long line" text refers to lines that are longer than 80 characters
before ending with a CR. One source for "long line" text is Windows based text
editors.

 Note: Since reformat procedures are used by both the printer routines (not
preserve CRs) and "Modify" 7.2, you can't reformat a file and print it at the
same time. TM will bring that to your attention if you try.

 Clipping ("Modify" 7.1) portions of a file allows you to enter line number
references.  Normally, you use the "lines" number display at the bottom of the
screen in "View" or "Read" modes.  Important: If you are reformating ("Modify"
7.2) and clipping ("Modify" 7.1) the file at the same time, use the "View" (not
"Read") after setting the reformat parameters, in order to get the correct line
number/s reference.  Then set the clipping parameters.  Most text editors allow
you to clip portions of a text file, but TM is good for very large text files
up to 65,535 lines.  There is an exception, if you were clipping (removing) to
the end of a file, "from" a line reference that does not exceed 65,535, then
the number of lines in the file can be in the millions.

 Does it bother you when you can't see where the CRs are in your text?  Most
text editors and word processors that I have used don't display CRs.  TM makes
them very obvious.  TM (v2.7) lets you see if the document has both CR and LF
(normal) or just CR, by the color of the symbol used to represent a CR/LF
(white = CR,LF and magenta = CR without LF).

 I am going to stop here and tell you something about the sequential order
in which "Modifications" and other modifying (stripping, etc.) functions occur
on each "line" of a document by TM.  Note: Documents without CRs, the "line"
ends at around 6,300 characters.  This may be important to know if a variety
of modifications are to be performed on the document in one pass (usually
not).  Let's assume all possible options are "active".

  Sequential order of modifications (if all are active):

  1. Non-text characters are replaced with spaces.
  2. Lower case letters converted to uppercase.
  3. Stripping (removing) a part/s of each line.
  4. "Modifications" (multiple modification procedures).

  "Stripping":

 Allows you to remove parts of each line.  The lines must have uniform
columns unless you select "Pattern" strip.  The pattern/s can be a single
character, word, etc.  You can strip from the beginning of each line up to the
pattern, from the pattern to the end of each line, or from one pattern to
another pattern.  Note: "Stripping" operates on each line before
"Modifications".  Character counting reference is the other form (no pattern)
of stripping.

 Note: "Stripping" removes a part/s of each line while "Clipping" ("Modify"
7.1) removes lines in the file.

 The "Modifications" order is just as they are numbered except with "modify"
number 7 (added later). Now the "Modification" order is:

 7.2 (Reformat or add CRs to text).
 7.1 Clip a portion/s of the text file (clip by lines).
 1 to 6 are in the proper order (following "Modification" 7).

 Example: Number 1 for spaces removal comes first.  Number 2 to reduce a
sequence of characters, is second, etc.  If all possible modifications are
being used, each line is modified in turn, starting with number 7 parameters,
then number 1,2,3,4,5 or 6 (you can't have both 5 and 6 active at the same
time).  You should be aware of this since some odd affects can result if you
don't think about the order.  Here is a simple example: You use option number
3 to remove a pattern and entered the same pattern in option 4 to replace it
with another. By the time number 4 operates on the line, the pattern won't be
there (removed by "modify" number 3).

 For "Modifications" 1 to 6 (except 3), there are 3 categories: case
sensitive, insensitive, and numbers (decimal) that represent characters
(usually used for non-text such as control characters, but can also be text
characters). These are performed in the same sequential order as their
numbers.

 Important notes:

 1. If you "Modify" a file (create another file) and you notice that it is
smaller than the original, one possible reason could be that the original file
contained zeros.  Since a zero is used as an end of line reference during
"Modifications", all zeros that are found in the original file are discarded.

 2. Since there is such a wide range of possible combinations in performing
more than one modification on a file at the same time, I have no way of
knowing about the possibility of conflicts.  However, you need not worry if
the outcome is not what you expected since the original file is never altered.
The "View a file" allows you to preview the outcome of modifications before
you decide to print or create another file.  I do know if you are clipping
("Modify" 7.1) a "long line" text file, and at the same time, you are
replacing ("modify" 4) or removing ("modify" 3) a pattern, there is a
possibility that the pattern could be spilt and not found to be replaced or
removed.  The pattern will not be lost because it is split, but it won't be
changed or removed.  Since "Clipping" counts screen lines (up to 80 characters
per screen line) as a reference, "long line" text is ended in the line buffer
at 80 characters for line counting (clipping reference).  The solution is
simple, perform the clipping "modification" on a second pass.

 3. Modifications on documents without the standard CR,LF (or CR) ending each
line may not always be complete due to the limited size of the line buffer.
It is possible for a "pattern", which contains more that one word, to be
split, one word of a two word pattern can be in one "line" (near end of line
buffer) while the second word will be in the next "line".  This also applies
to reducing a sequence, etc.

 4. TM was not designed to be totally "idiot" proof.  One example: For
"Modifications", if you enter letters instead of numbers at the numbers
category, the outcome is uncertain (I never tried it).

  Setting lines per page (PgUp PgDn):

  New V2.9 feature, set the number of lines per page (PgUp/PgDn used while
viewing a file/s).  There are documents with multiple parts, and each part has
the same number of lines.  Setting this to the same number of lines used in a
part allows you to view the same related information at the same position on
the screen when you press pgdn or pgup.  One example is a list of names,
addresses, phone numbers, etc.  With the lines per page properly set, each
PgDn press will display the name, etc. at the same position on the screen.

  CONCLUSION:

  This is NOT a "free" program.  A one time donation is expected.  You choose
the amount ($5.00 minimum).  For your donation, you will become a "donor".
Your name, etc. will be added to the "donors" list.  As a "donor" (one time
donation), you can select (ask for) one or more programs to receive FREE such
as "Tree Restore", etc.  See (use "VIEW-DOC") "OTH-PGMS.TXT" for information
about other programs.  Please include your e-mail address with your donation,
and the name/s of the other program/s you want (if any).  I will tell you in
the email message about the attachment (programs.zip) so you know it is safe
to open.  As a "donor", you will be entitled to receive all improved and new
programs (at your request) developed in the future (sent to you by e-mail).
As a "donor", you may request (from time to time) the latest list of programs
from which you can select to receive FREE.  If you know another shareware
author with a better offer, please let me know.

  The donation will motivate me to develop more programs and make improvements
in existing programs (add new features).

  Comments or complaints are always welcomed via email.  If you use "snail
mail" and expect a reply, please include a S.A.S.E.

  If you are overseas, the local bank charges a $10.00 service fee for checks
outside of U.S. I recommend that you send U.S. cash instead.

  Send $5.00 (or more) check, money order, or cash (put in foil for security)
to:

                     John Augustine N3AOF
                     3129 Earl St.
                     Laureldale, Pa 19605

            E-Mail:  jaugust@bellatlantic.net

