home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR8
/
GLEDIT24.ZIP
/
GLEDIT.DOC
next >
Wrap
Text File
|
1993-07-15
|
18KB
|
385 lines
GLEDIT
Global File Editor
USER'S GUIDE
Copyright 1990, 1993 by Gary C. Crider and
Parity Solutions
TABLE OF CONTENTS:
What is GLEDIT? .................................. 1.0
The GLEDIT command line .......................... 2.0
Operational Notes and Cautions ................... 3.0
Locating Data .................................... 4.0
Modifying Data ................................... 5.0
Printing or Saving the Output .................... 6.0
Return Codes ..................................... 7.0
Installation ..................................... Appendix A
Disclaimer ....................................... Appendix B
Support .......................................... Appendix C
Registration ..................................... Appendix D
1.0 What Is GLEDIT?
GLEDIT lets you globally search for, and optionally replace, a string of
characters in all selected files a directory. If you are familiar with GREP
from Borland International, you know the power of being able to search all
.BAT files in your BATCH directory when you move some applications to a new
disk volume. You are able to tell immediately which batch files need to be
modified.
GLEDIT takes it a step further in letting you also specify the string that
is to replace the search string and does the update of the file for you. It
prompts you before changing each line that may require modification.
2.0 The GLEDIT Command Line
Format:
GLEDIT [path]filespec "searchstring" ["replacestring"] [switches]
The "filespec" is the file name of the file that you want to search or
edit. If the "filespec" is a wildcard specification, all matching files in
"path" will be searched/edited. If "path" is not specified, the current
directory is used. If a mapped network directory is used for the path, the
full directory path should be specified, rather than just the drive letter.
For example, use W:\UTIL\*.* rather than W:*.* if W: is mapped to the UTIL
directory. Do not use the actual network drive names in the path such as
APPL:\UTIL\*.*.
The "searchstring" is the string of characters to look for in each
matching file. It should be enclosed in quotes if it contains spaces, commas
or characters other than letters or numbers.
The "replacestring" is the new string to be inserted in place of the
"searchstring". It does not have to be the same length as the "searchstring".
The new record length will be adjusted to accommodate the replacement. It
should be enclosed in quotes if it contains spaces, <, >, or |.
Either string may contain quotes by typing \q (lower case) in place of the
desired quote(s).
The replace string may not be the same as a switch, even if enclosed in
quotes. The switch characters may be embedded within a replace string.
Switches:
/I indicates case-insensitive searching where the search argument and the
target record will match if they contain the same letters regardless of
upper or lower case. /I has no effect on "replacestring". The "replace-
string" is inserted as entered in the command line.
/D instructs GLEDIT to delete the specified searchstring whenever it is
encountered. It works just like the normal replace option with the
replacestring set to a null string. You need not specify a replacestring.
If you do, it will be ignored.
/N directs output to the standard output device (normally the display).
GLEDIT normally writes to the screen with color highlighting of the matched
string. Output directed to the screen cannot be redirected to another
device. The standard output can be directed to another device such as
a file or printer. If you specify /N and do not redirect the output, it
will appear on the screen without color highlighting.
/S is ignored if "replacestring" was specified. If not specified, the
scrolling text on the display will pause for a key to be hit between files
with matches for "searchstring". If /S is specified, scrolling is continuous.
/Y is used to automatically reply Y to the replace prompts when in
edit (replace) mode. Please see "Operational Notes and Cautions" before
using this parameter.
/T (test mode) performs just exactly like /Y except that no changes are
actually made to any files. You can test the results before changing it to
/Y.
3.0 Operational Notes and Cautions
Please note that GLEDIT is intended for use in ASCII text files that
use the standard CR/LF record delimiters. If you use it on binary or non-
standard files, the resulting file will probably be unusable. If you use
GLEDIT on indexed database records and substitute unequal length strings, you
are almost sure to corrupt your database. GLEDIT does not back up files
before replacing them, so be careful and be sure of what you are doing. The
safest approach is to backup the directory, possibly in an archive (.ZIP,
.ARC, etc.) file before editing with GLEDIT.
GLEDIT has two modes of operation, search and edit. Whenever a replacement
string or /D is specified, edit mode is activated. If no replacement string
is provided and /D is not specified, search mode is invoked. In search mode,
no file writes whatsoever take place, therefore no data is modified. When
edit mode is invoked, a work file is written to the target directory. As
each record is read in, it is also written to the work file, modified or not.
When GLEDIT reaches end of file on the input file, it checks to see if you
had elected to make any modifications. If so, it deletes the input file and
renames the work file to the name of the input file. The point of relating
all of this is that you should not specify a replacement string or /D if you
are just looking for occurrences of a string. Edit mode has much higher
overhead.
Please be extremely cautious when using the /Y parameter. This is for
users who like to live on the edge and believe, "It's my data and I'll
corrupt it if I want to." A miskeyed command line or not thinking through
what is going to be the result can cause file damage on a vast scale. If
/Y is specified, the only way to stop it is with CTRL-BREAK. Even this
could cause a file to be damaged. Specify BREAK=ON in your CONFIG.SYS
file to make sure you can break out if things are going badly. Use the
/T switch to test the result before changing it to /Y.
It is a good idea to use /N and redirect the output to a file or printer
during execution of /Y or /T. This gives a log of the results. See Printing
or Saving the Output.
If at any time you wish to abort a search, press the ESC key.
4.0 Locating Data
The primary purpose of GLEDIT is to let you find files that contain certain
strings, generally because the strings need to be modified, but not always.
If you just want to find what files contain a certain string, just enter
the GLEDIT command without a replacement string and do not specify /D.
GLEDIT will begin going through the target directory finding each file that
matches the filespec you provided in the command line. It will search each
of the matching files for the search string you provided. When found, the
file name will be displayed along with any records in the file containing the
search string. If you did not specify /N, the text will be light gray on a
black background with the search string highlighted in light red text. If you
did not specify /S, the display scrolling will pause at the end of each file
with matching strings and wait for a key to be pressed before proceeding to
search the next file.
5.0 Modifying Data
Edit mode processing involves everything described under Locating Data
(except /S) plus you are prompted to reply Y or N depending on whether or
not you want matching records updated as each is displayed. GLEDIT also
displays the modified line as it will appear if you reply Y. You can see
the result before you accept it.
6.0 Printing or Saving the Output
To print the output of a search, or an edit using /Y or /T, specify the /N,
and /S if in search mode, parameters and redirect the output to the printer:
GLEDIT *.TXT "MOM" /N /S >PRN
or log to a file:
GLEDIT *.BAT "G:" "H:" /N /T >C:\GLEDIT.LOG
You can use >> instead of > if you want the output appended to a log file
instead of creating a new log each time.
Do not use redirection when using edit mode (without /Y or /T) or without
the /S in search mode. The resulting pauses will make it appear that GLEDIT
is hung, since you will not see the prompts. If this happens, repeatedly
pressing N will allow GLEDIT to progress to completion.
7.0 Return Codes
The following DOS ERRORLEVEL return codes are returned from GLEDIT:
0 - One or more matches found. Replaced or not replaced has no bearing.
1 - No matches found in any files searched.
2 - No files found matching the search file specification.
3 - Invalid path specified in serach file specification.
4 - Directory recursion error. Please report to Parity Solutions.
Should never happen.
255 - User abort. ESC key pressed. Does not detect BREAK key.
APPENDIX A
Installation
GLEDIT is distributed in a ZIP file called GLEDIT.ZIP. It contains the
following files:
GLEDIT.EXE The executable file for GLEDIT.
GLEDIT.DOC The documentation file.
GLEDIT.HST History of changes to GLEDIT.
GLEDIT.Vnn Description of changes to implement version nn,
the current version.
For best results, unzip the file into a directory on your PATH. If you
don't use a directory in your path, you will have to designate the directory
containing GLEDIT.EXE when executing the program.
If you have a utility directory that is on your PATH, this is an excellent
location for GLEDIT. An example installation would be:
C:
CD \UTIL
COPY [path]GLEDIT.ZIP
PKUNZIP GLEDIT
DEL GLEDIT.ZIP
The PKUNZIP program is by PKWARE, Inc. and is available in many CompuServe
forums under the file name of PKZ110.EXE or PK204E.ZIP. Since you are reading
this doc file, you have obviously already managed to unzip the distribution
file. If it is not currently in your path, simply copy all of the files to a
directory in your path. Keep the GLEDIT.ZIP file anywhere you like, but give
plenty of copies, as is, to your friends. If you register GLEDIT, you are not
licensed to give your serial number to anybody without first removing the
serialization from your copy.
APPENDIX B
Disclaimer
BECAUSE OF THE DIVERSE NATURE OF COMPUTER EQUIPMENT AND EXPERTISE OF USERS,
PARITY SOLUTIONS AND GARY C. CRIDER MAKE NO WARRANTY ON THE GLEDIT PROGRAM
WHATSOEVER, EXPRESSED OR IMPLIED. THE USER ASSUMES ALL RISK OF DAMAGE TO
DATA OR EQUIPMENT RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OR MISUSE OF
THIS PROGRAM PRODUCT. THE USER MUST BE AWARE THAT USING GLEDIT TO MAKE
ALTERATIONS TO PROGRAMS OR DATA CAN RENDER THAT PROGRAM OR DATA USELESS.
USERS ARE ADVISED TO TEST MODIFICATIONS MADE WITH GLEDIT THOROUGHLY ON FILES
FOR WHICH A BACKUP EXITS. ANY LIABILITY OF THE AUTHOR OR PARITY SOLUTIONS IS
LIMITED TO REPLACEMENT OR REFUND OF THE REGISTRATION FEE.
APPENDIX C
Support
I have tried to test the program to the fullest, but I am limited as to
systems and configurations with which to test. I have been programming for 18
years and the one thing I know for sure is that bug free programs are very few
and far between. I can only promise to support the program to the best of my
ability and provide fixes as expeditiously as possible. GLEDIT has been used
at my home and work site extensively for several years and has proven to be a
reliable tool.
Anyone can report problems and suggest changes. Registered users get top
priority in resolving their problems. There are three ways you can report
problems. The preferred method is to contact me through CIS mail (not forum
messages). My CIS ID is 71760,3413. You can also write me at:
Gary C. Crider
Parity Solutions
1105 Burgess Court
Arlington, TX 76015
The last method is to phone (817) 467-7818. Since I am the sole technical
support and the line is also used for my network consulting business, it is
often hard to get through to me. Please call and leave a message between 7:30
am and 5:30 pm Central time.
No matter which method you use, please give a brief description of your
problem, your registration serial number if you are registered, and your phone
number. If I need more information, I will contact you as soon as I can.
When I have a solution, I will contact you however you prefer.
I work full time, have a consulting business to run in my spare time and
write programs instead of sleeping. So please be a little patient with me.
Program updates are available on CompuServe or can be requested from us
for a $5 shipping and handling charge. Add $1 for international shipping
outside the North American continent. A distribution disk of all Parity
Solutions products will be sent to you. Specify disk size and format.
APPENDIX D
Registration
I begin with an apology. I hate programs that in any way inhibit func-
tionality or performance for the shareware version. But when it came down to
feeding the family and paying the bills, I had a change of heart and inserted
a pesky notice that pops up at the beginning and gets on your nerves. I
chose this approach above that of limited functionality. The program's full
capabilities are available for you to evaluate before you invest your hard-
earned money.
You may use GLEDIT unlicensed for 30 days, after which time you are
required to be registered.
Registered users will receive a unique serial number and instructions on
how to serialize the program. Serialization can be re-applied to updated
versions and in no way hinders your use of the program. You can compress or
decompress the program with no effect (LZEXE or PKLITE). I use Fabrice
Bellard's LZEXE program on GLEDIT.EXE before distribution.
As a registered user, you will be able to update without re-registration
or additional fees. You will also be kept on my PRIVATE mailing list to
receive additional information on other Parity Solutions products.
To register your copy, please send $16 ($45 per file server on LANs) check
or money order (sorry, no credit cards yet) to:
Gary C. Crider
Parity Solutions
1105 Burgess Court
Arlington, TX 76015
Or, you can register online quickly and simply on CompuServe. Simply
GO SWREG and register ID #754. Your registration will be added to your
Compuserve bill. International exchange was never easier.
If you send your CIS ID or register via SWREG, your registration will be
sent to you via CIS mail, along with instructions on how to serialize your
copy of GLEDIT. This usually involves one day or less turnaround.
Program diskettes are not normally shipped. Normal distribution is via
CompuServe. If you need a diskette, please see the instructions under Support
above. You will receive a serial number and instructions for serializing
your copy of the program.
Each license gives you or your company a single-use permit for GLEDIT. It
is not restricted to a single machine as long as no two users can be simul-
taneously using the program. As Borland says, "treat it like a book." As an
example, if you register GLEDIT for your home computer, but during the day you
use a portable or a computer at work, you may keep GLEDIT on both machines as
long as no one is at home using it on your home computer.
LAN licenses grant rights to all users of a file server. If inter-
networking, a license must exist for each file server that contains a copy
of GLEDIT.EXE. If two or more file servers exist on a single LAN strictly for
mirroring data and fault-tolerance, these will be counted as a single file
server for licensing purposes. If in doubt, contact me. We can work out
an agreement.
Site licensing is also available on a negotiated price basis. I guarantee
it will be an economical alternative to buying licenses for each user.
If you are a registered user of GEDIT from Parity Solutions, you may use
your GEDIT serial number to serialize GLEDIT.
You may freely distribute the original GLEDIT.ZIP file in any way you see
fit other than selling it. Users' groups and shareware distribution services
may charge a reasonable fee for the medium and duplication costs, not to
exceed six dollars. Bulletin boards may not charge additional fees for
downloading this specific program, other than normal connect-time and/or
membership charges.
You are NOT licensed to give anyone your serial number unless you first
remove all serialization from your computer. You may then no longer use that
serial number. Only Parity Solutions has the authority to issue serial
numbers.
Disassembly and/or modification of GLEDIT.EXE to attempt to bypass serial-