home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
st102a.zip
/
ST.TXT
< prev
Wrap
Text File
|
1995-08-29
|
5KB
|
152 lines
ScanText v1.02a Manual
ScanText is a program that counts the number of lines in a file or directory
in which there are occurences of a single word or a string of words.
Syntactical note: ``[]'' indicates optional parameters, ``<>'' indicates
required parameters, and ``|'' indicates a logical OR. You should not enter
any of these characters when you input the command.
Definitions: the word ``string'', when used in this manual, means any
combination of characters that includes one more more spaces, e.g.,
"Stephen King". ``word'' means any combination of characters except for the
space character, e.g., "King".
SYNTAX
ScanText runs in two modes: searching a single file for a word or string;
and searching a directory for a word or string. These modes are just
different enough to require two general command-line sytactical diagrams.
The options will be described in more detail after the diagrams.
This is the general command-line syntax you must use when searching a single
file for a word or string:
st [drive:][path]<filename> <word>|"<string>" [ - | + ] [ # | l ]
1 2 3 4
And this is the general command-line syntax used for searching a directory
for a word or string:
st [drive:]<path> <word>|"<string>" [ - | + ]
1 2 3
Options
1: Single file search mode -- enter filename only if in current directory,
else include path to the file.
Directory search mode -- enter directory to be searched if on current
drive, else include drive letter to directory.
2: Both modes -- if searching for a string, then enclose in quotes. If
searching for a word only, quotes may be omitted. Note: <word> is
equivalent to "<word>".
3: Both modes -- enter ``-'' for case-insensitive searching (default), or
``+'' for case-sensitive search.
4: Single file search mode -- enter ``#'' to return a count of the number of
lines that contain the word or string (default), or ``l'' to return the
actual lines in which the word or string occurs.
Directory search mode -- no ``l'' option for directory searching.
EXAMPLES
In the following example, books.txt is a file and \BOOKS is a directory.
C:\> st books.txt king
C:\> st \BOOKS king
Will count the number of lines in which there are occurences of "king"
(case-insentive) in books.txt or \BOOKS and display this number. Words
that, using these options and if they are present, will add to the count
include: "King", "KING", "King's", and "SKing".
C:\> st books.txt "king"
C:\> st \BOOKS "king"
Identical to the previous example.
C:\> st books.txt King +
C:\> st \BOOKS King +
Will identify lines that contain the word "King" in the proper case.
Trigger words include: "SKing" and "King's".
C:\> st books.txt "Stephen King"
C:\> st \BOOKS "Stephen King"
Will identify lines containg the phrase "stephen king" (case-insensitive).
Trigger phrases include: "stephen king's", "STEPHEN KING", "Stephen King's",
and "author--stephen king".
C:\> st books.txt king #
C:\> st \BOOKS king #
Will search for "king" (case-insensitive) and display the number of lines in
which this string occurs. (default condition, no need to enter)
Note: ``#'' is optional in directory search mode.
A) C:\> st books king
B) C:\> st \books king
Will search subdirectory C:\books for files that contain "king" (any case),
and display the number of lines in which it occurs. Syntax A and B are
identical. If the search directory is a subdirectory of the current one,
a backslash is not necessary.
C:\> st books.txt king l
Will display the lines in which the word "king" (case-insensitive) occurs,
in addition to the count.
C:\> st \BOOKS king l
Illegal. Will return an "Options Error" -- line-display is disabled in
directory search mode.
CREDITS
ST - ScanText / Copyright (c) 1995 Andrew Tsai & Jawed Karim
Programming:
(base) : Andrew Tsai & Jawed Karim
(added options, : Jawed Karim
path support )
Report bugs in ST.EXE to: Jawed Karim <kari0022@gold.tc.umn.edu>
Online help: Copyright (c) 1995 Dan Rogovin
Manual: Copyright (c) 1995 Dan Rogovin (25Aug95, rev C)
Report problems in the manual to: Dan Rogovin <rogo0009@maroon.tc.umn.edu>
Visit one of these World-Wide Web pages:
Dan Rogovin: http://www.umn.edu/nlhome/m101/rogo0009/dan.html
Jawed Karim: http://www.umn.edu/nlhome/g346/kari0022/jawed.html
[The newest version of ScanText is always available on this page]
VERSION HISTORY
1.02a: Minor case sensitivity bug in [drive]:\[path] fixed.
Improved documentation.
1.02 : Fixed nasty bug, wouldn't let user scan single files :-/
completely rewrote half of code.
1.01b: Fixed directory bug, alternative drive wouldn't switch back to
default directory.
Changed output, looks better.
1.01a: Fixed alternate drives bug; before, if entered would scan c:\
1.01: New feature: let's user search for strings! " ... "
New feature: entire paths can now be scanned.
1.00: First release version. Visible bugs worked out of 0.9x
0.9x: Beta versions; various options added