CHANGE3.ZIP (CHANGE.ASM, CHANGE.COM, CHANGE.TXT) Thanks to Michael Mefford (Ziff-Davis Publishing Co, the folks who bring you PC Magazine) for the original version of this handy utility. Unfortunately, in its original form, it had a slight bug. When a file was increased too large the program did not detect this and trashed the file. Also it didn't completely meet our needs. Changes we made include correcting the bug, decreasing the size of the change buffer from 20K to 10K to allow CHANGEing larger files, a test for impending buffer overflow and several more informative error messages and a CR LF sequence was added to all the messages for cleaner use in batch files. The .ASM listings for both versions are included for those of you who may wish to make further refinements. More misc info, limitations, etc.... Maximum filesize for FILENAME before the change is 50K bytes. The format for using CHANGE is CHANGE FILENAME "old-text" "new-text" The maximum amount you may increase filesize is 10K. (if the length of old-text is about the same as new-text, you're in good shape - if you want to change every occurance of "e" to "asdfghjklqwerty" in a 50K file, CHANGE may not be the right utility for the job). CHANGE now checks for an impending buffer overflow and aborts the change before this occurs - with an error message. FILENAME is (obviously) the name of the file you wish to change. ALL occurances of old-text are changed. OLD-TEXT and NEW-TEXT may be any strings except the quote sign. The OLD and NEW text strings enclosed in quotes must be separated by a space. ASCII characters may be included by their codes too - separate them from the string in quotes with a comma. For example, to change " ABC" to "esc DEF" in a file called TEXT1... CHANGE TEXT1 27,"ABC" "esc DEF" New with Version 3 is a Wildcard Character (?) in the "old-text" which will match any character except a Line Feed or Carriage Return in that postition allowing for tricky substitutions. ie. for changing Telemates Prefix and suffix strings that are defined in the file TM.CFG one could use the commands Change TM.CFG 'DialPrefix1="ATDT????"' 'DialPrefix1=%DIAL-PREFIX%' > NUL Change TM.CFG 'DialSuffix1="?????"' 'DialSuffix1=%DIAL-SUFFIX%' > NUL Assuming that the Environment Variables were set first to an appropriate string (such as SET DIAL-PREFIX="ATDT9W--" or "ATDT----" or "ATDT*70W" and SET DIAL-SUFFIX="---^M" or "W62^M") you can now match a entry using a mask and CHANGE it even though part of the text content is unknown. The replacement must be the same length as the origional (note padding with '-' above) for the example to work but is not manditory for other uses. ie, to remove certain patterns you could use CHANGE TEXTFILE "NOMORE:????" "" Wildcards in the NEW-TEXT are not supported (this would be difficult at best as the lengths of OLD-TEXT and NEW-TEXT are not required to be the same.