home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
util
/
mayflower.lha
/
MayFlower
/
TrimLines
/
TrimLines.doc
< prev
next >
Wrap
Text File
|
1994-06-10
|
8KB
|
172 lines
--- ---
(o) (o) TrimLines 5.0 (19940312)
^
\_____/ by Stephen D Childers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** WARNING !!! *** *** WARNING !!! ***
This program can damage [ouch] important files if not used properly.
Do not use this program on original files unless you know exactly
what you are doing.
This is the warning that should have been given with previous
releases of this program.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Program Description:
1) This program will take a text file and remove the space characters
from the end of each text line within that file.
2) It will print a total count of spaces removed.
3) It can only be run from CLI. Can be made resident.
4) Program (when run from CLI) will interact with the 'c:Why' command
after program failures; this command may provide a more detailed
explanation of why the program failed.
The 'Why' command should be used immediately after a program
failure to extract the last program's result code, because
that result code is changed upon the execution of the next CLI
command.
5) Certain error reports will contain the name of the arg, file,
device, (etc) that is associated with failure when it occurs.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reason for program's existence:
Let us suppose that the following line appears in one of our library
text files (minus the quotes).
"This ends the first paragraph. "
And let us suppose that the LF (LineFeed) or CR (Carriage Return) for
this line begins right after the end quote. As you can see; there is
a lot of blank space being stored in this text file line before the
CR or LF is reached.
And let us suppose there are over a 1000 lines similar to this last
line which have blank spaces extending the length of the line before
the CR or LF is reached.
It now becomes apparent that the size in bytes of a text file in this
condition could be very large, thousands of bytes larger than normal.
Larger than what is necessary for a normal text file being stored on a
library diskette. I suppose that there are times when certain text
files may need to be left in this condition, but there are times when
text files do not need to be stored in this condition.
NOTE: I first discovered the existence of excessive spaces one day
while I was using Ed to browse around some message text files that
were captured from certain computer bulletin board systems. This is
what motivated me to write this program.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CLI Usage:
Usage 1 > TrimLines [!] [[-options] input output]
! = show author info
options: q = Quiet; do not print messages
o = Overwrite input, output arg not needed
input = file to be trimmed
output = where to put trimmed file
CLI Usage notes:
1) The options arg can appear any where within the command line
template, thereby allowing this program to be used with various
"S:SPAT" like script files, thus allowing the use of wild
characters.
ie > Execute SPAT TrimLines *.txt -o
or > Execute SPAT TrimLines #?.txt -o
2) Input arg must be a file and can not be a device or directory,
and output arg can designate a device and/or directory as the
destination for trimmed data. If output arg is not a file then
input file name will be taken and used for the output file name.
ie > TrimLines manyspaces.txt df0:
or > TrimLines yeowspaces.txt df0:stuff/
3) If the output arg is not given (and option -o is not selected) then
the input arg (file name) will be used in creating the output file
name, and that name will have the extension ".TLS" appended to it.
Output will be put in same directory as input file.
4) If the output arg is a device or directory name then a copy of
the trimmed input file is sent to the given directory.
5) Option -o does not require the output arg, and output arg will be
ignored if option -o is specified.
6) Option -o requires loading all of the input file into memory, and
if there is not enough memory the program will inform you to try
again without -o option.
7) Option -o will not overwrite input file unless the spaces removed
is greater than zero.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Version History:
The following information briefly describes changes or improvements
made to each version, and they will be described in descending order;
meaning latest version information begins first:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 5.0 (19940312) -
1) Changed version numbering format. Program can now be used with the
"Version" command. Date within parenthesis is shown in a somewhat
international format as (yyyymmdd).
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 19930803 -
1) Optimized and refined source code thereby making program smaller.
2) Added "*** WARNING !!! ***" paragraph to document file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 19920105 -
1) Removed a CLI parsing problem.
2) Can be made resident.
3) Added option -o.
4) The options arg can now appear any where within the command
line template.
5) Input arg must be a file, and output arg can now designate a path.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 19910917 -
1) The usage template has changed.
2) Improved error reports.
3) Program (when run from CLI) will now interact with the 'c:Why'
command after program failures.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Version 19910631 - The first version.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _
(_) (_) (_) (_) (_) (_) (_) (_) (__) (_) (_) (_) (_) (_) (_) (_) (_)
//\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/\\
// \\
\\ 28 And even as they did not like to retain God in their //
// knowledge, God gave them over to a reprobate mind, to do \\
\\ those things which are not convenient; //
// 29 Being filled with all unrighteousness, fornication, \\
\\ wickedness, covetousness, maliciousness; full of envy, murder, //
// debate, deceit, malignity; whisperers, \\
\\ 30 Backbiters, haters of God, despiteful, proud, boasters, //
X inventors of evil things, disobedient to parents, X
// 31 Without understanding, covenantbreakers, without \\
\\ natural affection, implacable, unmerciful: //
// 32 Who knowing the judgment of God, that they which \\
\\ commit such things are worthy of death, not only do the same, //
// but have pleasure in them that do them. \\
\\ //
// The King James Holy Bible - Romans 1:28-32 \\
\\ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ //
\\/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \__/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \//
(_) (_) (_) (_) (_) (_) (_) (_) (__) (_) (_) (_) (_) (_) (_) (_) (_)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
End Of Document