home *** CD-ROM | disk | FTP | other *** search
-
- GR - General Replace
-
- This program replaces text substrings in the input file based on
- specifications in a "token file". While any text editor or word processor
- can replace text, the advantage of GR is that up to 100 replacements can be
- done on one pass over the text. While AWK can to the same thing, GR is
- easier to use and much faster.
-
- GR COMMAND LINE
- ---------------
-
- The call to GR is:
-
- GR inputfile outputfile tokenfile
-
- All fields are required and GR will error if there are less than 3 fields.
- The images in the tokenfile are read and parsed. Then, the text lines are
- read from the inputfile, processed and written to the outputfile.
-
- The inputfile and outputfile should not be the same file. If they are, the
- results can range from strange to disastrous.
-
- TOKENFILE FORMAT
- ----------------
-
- Images in the tokenfile are in the format:
-
- searchstring=replacestring
-
- for example
-
- \xx=This string replaces xx
-
- Any leading or trailing spaces are significant. Any spaces on either side
- of the = sign are also significant. This means that
-
- \xx = This string replaces xx
-
- is different than
-
- \xx=This string replaces xx
-
- The images in the token file are applied against each line of the input file
- in the order they appear in the tokenfile. This means that
-
- \t=A short string
- \tb=A replacement string
-
- will not have the results you might expect. It should appear in the token
- file as:
-
- \tb=A replacement string
- \t=A short string
-
- This order of evaluation also means that replacements can be "nested", for
- example
-
- \xx=This string will have \tt replaced by a subsequent definition
- \tt=This replaces part of the replaced string above
- \ss=The \xx in this string will NOT be replaced by the above
-
- THE GRR PROGRAM
-
- No, this is not for frustrated programs to express their feelings! This
- program is intended to REVERSE the effects of GR. It reads the same "token"
- file as GR, but replaces "replacestring" (see above) with "searchstring".
- It also processes the definitions in the tokenfile in REVERSE order. All of
- this is an attempt to restore the text to its original state, which could be
- handy if it has been edited since conversion. GRR does its best; however,
- since the process does not involve any artificial intelligence, GRR may not
- restore the text to its EXACT original state. In fact, it could fail
- miserably if the conversion was complex. Always inspect the REVERSEd file
- after GRR is done.
-
- Example:
-
- GR infile outfile deffile /* Convert originally */
- < Other stuff goes on here >
- < or nothing goes on here >
- GRR outfile anotherfile deffile /* Attempt reverse conversion */
-
-
- MAINTENANCE HISTORY
-
- Level 1R1A - The original GR and GRR are case-insensitive, which may not be
- desirable for all uses, also it can cause problems when the
- string to be replaced duplicates the replacement string except
- for case. Therefore, you will now find two versions of GR,
- etal. GR and GRR are the case-SENSITIVE versions and GRI and
- GRRI are the case-INSENSITIVE versions.
-
-
- THE USUAL STUFF
-
- If you like this program, a registration of $5 would be appreciated. All
- persons who register will be notified of any updates to this program and of
- the availability of other programs produced by The Lone Consultant.
-
- The Lone Consultant
- 996 Burns Ave.
- St. Paul, MN 55106
-
-
- The Lone Consultant disclaims all warranties, either express or implied,
- including but not limited to any implied warranty of merchantability or
- fitness for any particular purpose.
-
- In no event will The Lone Consultant be liable for any damages whatsoever
- (including without limitation damages for loss of business profits, business
- interruption, loss of business information or the like) arising out of the
- use of, interruption in the use of, or inability to use this software, even
- if The Lone Consultant has been advised of any possibility or likelihood of
- such damages.
-