home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
filedocs
/
simraz13.arc
/
SIMRAZOR.DOC
< prev
next >
Wrap
Text File
|
1989-12-18
|
7KB
|
168 lines
S I M R A Z O R 1.3
====================
A squeezing utility for SIMIBM file indices
TapirSoft Gisbert W.Selke
December 1989
The index to the the Info-IBMPC lending library, as stored on Simtel20
and redistributed by various other servers, is quite handy for finding
public domain or shareware programmes you are looking for. Since it
comes in standard mailmerge format, it is easy to import into just about
every database programme you like.
However, it is quite large, and if you keep it on your harddisk, gone
are a few hundred kilobytes of space. That's the price you pay... But
wait! You can save some of that room, if you think about it: you don't
need the 'disk' field at all, since it is always "PD1:". Then, the
'directory' field invariably contains the string "<MSDOS", hence, this
is redundant, too. The 'version' field is mostly useless, since the
version number is generally recorded within the file name; and, at least
for some of us, the 'type' field (i.e., 7 or 8 bits) is irrelevant, too.
(You can usually tell the type from the file extension, anyway.)
Thus, throwing out the superfluous items, we can save some 60 KB, given
the 4000-odd files that are in the archives as of this writing - which
is quite a lot for someone chronically pressed for disk space, like
myself!
So there you are.
As an added bonus, or rather, as a left-over from olden times, several
input files may be merged into one output file. Note that no sorting is
performed; each individual input file must come sorted.
Since not everyone may like my opinions on what is relevant, I made all
the items configurable via the command line; so you specify
- the names of the input files (up to five; you never know what happens
next...);
- the name of the output file (one only);
- the output fields, in the order you prefer, optionally with maximum
field widths (up to fifteen output fields are possible). Output widths
may be negative, in which case the right-most part of the field is
considered to be more significant.
An input file specification looks like this: '/Ifoobar' (without the
quotes, of course). If you specify no extension, '.IDX' is added
automatically.
The output file specification looks like '/Obarfly'; again, '.IDX' is
added, if no extension is present.
The specification of output fields is slightly more complicated; it
works like this: label the eight fields in the input files with the
letters 'A' to 'H', plus the special letters 'I' and 'J':
A : disk F : file type
B : directory G : file date
C : file name H : description of contents
D : version number I : sub-field of B: major directory
E : file size J : sub-field of B: subdirectory
The last two may be used to split the directory name, like '<MSDOS.
FILEDOCS>', into its components, 'MSDOS' and 'FILEDOCS'.
Now you refer to them as '/FA', '/FB', etc. - Optionally, you may add a
maximum field width right after the field letter; SIMRazor will truncate
fields that are longer, depending on the field type: if a field is too
long and it is numeric, the field is replaced by all 9's; if it is
alphabetic, it is truncated from the right. E.g., '/FE6' will make sure
that no file size is larger than 6 digits. (Yes, there is actually one
file there that is larger than 1 MB; with '/FE6', your database import
programme will not cough on this any longer.) - On the other hand, if
the field width is negative, truncation of text fields starts from the
left; this allows you to extract, e.g., the '2' from the directory name
'<MSDOS2.MODEM>'. - There is one special case: the 'I' field is padded
with a blank on the right, if it contains a simple 'MSDOS'.
All input is case-insensitive. Note that the various parameters are
separated by spaces, but that there are no spaces within parameters.
Of course, you won't want to keep all this in your (biopositronic)
memory; so if you call SIMRazor without parameters, you'll get the usual
old usage screen. At any rate, I suggest you figure out what you like
best, and then prepare a batch file, like the one supplied in this
package. That way, you can safely forget all of this. You might also
bundle the unarchiving process and the import into your database
programme into this batch file.
If all this sounds very confusing, here are a few standard examples of
how to call SIMRazor:
SIMRAZOR /Fa /Fb /Fc /Fd /Fe /Ff /Fg /Fh /Isimibm /Inodescr /Osimboth
---> just merge two old-style files; no editing done
output sent to SIMBOTH.IDX
SIMRAZOR /Fb /Fc /Fe6 /Ff /Fg /Fh /Isimibm /Osimibm1
---> use one file only, drop 'disk' and 'version', check 'size' field
output sent to SIMIBM1.IDX
SIMRAZOR /Fh30 /Fc /Isimibm /Osimshort.txt
---> file descriptions (up to 30 chars), then file name, nothing else
output sent to SIMSHORT.TXT
SIMRAZOR /Fi-1 /Fj11 /Fc /Fe6 /Fg /Fh /Isimibm /Osimshort
---> merge the two files, using only relevant items, checking 'size',
extracting the MSDOS directory number
output sent to SIMBOTH.IDX
With this last call, and for some 4000 files in the archives, SIMRazor
takes less than half a minute on my 10 MHz AT clone, with a 40 ms
harddisk.
Enjoy!
History:
1.2 15 Oct 1989 First release to the public.
1.3 18 Dec 1989 Adapted to changed directory structure at SIMTEL
by allowing negative field widths and directory
name splitting. Quite a kludge; but what the heck,
it saves disk space.
The usual boring stuff:
This programme was compiled with Borland's TurboPascal 5.5 compiler. It
has been tested under MS DOS 3.3, on a 640kB AT clone. There should be
no problem recompiling with other versions of TurboPascal (maybe adjust
compiler switches...), or running it under other versions of DOS. For
each file, it tries to grab 64kB memory for i/o buffering; if it finds
none, that should be no problem either - it will just take longer to
run.
This programme is copyrighted by me, but it may be used and copied
freely, without any restrictions but one: don't pass on parts of this -
always give it away as a whole, i.e., executable, source, and
documentation.
This programme runs fine on my system, but I don't promise, let alone
guarantee, that it will do anything you'd like it to. The whole risk of
using it lies with you.
MS DOS is a trademark of MicroSoft Corporation.
TurboPascal is a trademark of Borland International.
Comments and suggestions for improvement are welcome; address them to:
Gisbert W.Selke
Ermekeilstraße 28
D-5300 Bonn 1
West Germany