Short: Replace strings in files (CLI-Pure) Author: dck@prometheus.hol.gr (D. Keletsekis) Uploader: dck prometheus hol gr (D Keletsekis) Type: util/cli Version: 1.3 Requires: WB 2+ Architecture: m68k-amigaos REP is a small, fast CLI command for replacing strings in files. It is pure and can be made resident. This version adds the ability to define HEX and non-printable characters in the string (read on..) Usage : ------------- > Rep FromFile/A, String/A, ToString/A, ToFile, I=Insensitive/S Where : ------------- FromFile - is the file you want to convert. String - The string you want to replace ToString - What you want to replace it with ToFile - (Optional) the name of the output file. If this is not given, then the INPUT FILE WILL BE OVERWRITEN! Insensitive - (Optional) Make the search case-insensitive Example : -------------- rep df0:MyFile ThisString ThatString Insensitive - will replace all occurences of "ThisString" (or THISstring, or ThIsStRiNg etc) with "ThatString" and save it over the original file. "String" and "ToString" are parsed and may contain HEX, DECIMAL and other non-printable characters. The way to do this is: The "\" character starts a character specification : \n - is the Newline character (decimal 10) \r - is the carriage return \t - is the TAB character \\ - is the \ character itself \" - is the " character \' - is the ' character \x - starts a HEX character string, defined by pairs of HEX digits (0-9,A-F) until another \ character or the end of the string are encountered. ex: MyString\x000003F3\continues \# - starts a DECIMAL character, defined by a number from 0-255. Again, the number ends with another \ character or the end of the string. ex: "\#155\32mWhite text" Any other character will be considered literally, i.e. \c - is the "c" character. There is also a GUI script included, which makes this litle command very powerful & easy to use if you want to make the same replacements in a lot of files. A preview is included. The GUI needs a program called Gui4Cli (also written by yours truly and what a great program it is too :), available at : 1.- http://users.hol.gr/~dck/gcmain.htm 2.- Aminet, under Dev/Gui/Gui4Cli.lha D. Keletsekis - dck@prometheus.hol.gr Novemeber 1997 This program is FreeWare, but remains the Copyright of D.Keletsekis. No guarantees as to it's performance and actions is made or implied. Use it at your own risk.