Ever had the job of finding and changing a piece of text that could be in hundreds of files? A typo in a template that was used to create the company web site? Moved office and the company address and phone number changed? The Publicity Officer has just retired and his name is liberally scattered through tons of pages? etc etc etc.
Well XChangeCL can make this much easier for you. It can find files using wild cards and find and replace multiple strings in each one.
Note: XChangeCL is primarily intended as a programmers' tool, and can only operate correctly on text files. These are sometimes known as flat files because they do not contain any text formatting information. More information...
XChangeCL is used from the command line like this:
XChangeCL switches filenames strings
Switches and strings are optional. You don't have to enter either, but you will probably want to. Recognised switches are:
|?||display this help|
|A||display information about this program|
|B||create backup file (default is to create backup with .~XC extension)|
|C||case sensitive (default is case sensitive)|
|Dd||set the string delimiters to d (default delimiter is /)|
|H||display this help|
|K||enter registration key, use -K "firstname surname" key|
|P||show progress (default is to show progress)|
|R||recurse through subdirectories (default is to not recurse)|
|Tt||set the "trip" character to t (there is no default trip character.) The trip character is used to indicate an ASCII code.|
|U||repeat the find/replace commands until no substitutions are made.|
|V||verify command. Display the options, find/replace strings and file names, but don't actually change anything.|
|W||whole words only (default is not whole words only.) Words are defined as any number of consecutive characters that are all in "A" to "Z", "a" to "z", "0" to "9", "_", "$" or "£". Any other characters are treated as word delimiters.|
Switch characters are preceded by a - to switch the attribute off (if appropriate) or a + to switch the attribute on.
Filenames may contain wildcards and multiple filenames can be separated by semi-colons or commas. Enclose filenames in quotes " if they contain spaces or other special characters.Note: ensure that the first character of the filename is not the specified string delimiter - it will be interpreted as a string if it is.
The find and replace strings are surrounded and separated by delimiters. If the strings are omitted then the filenames can be displayed (use +P) to verify what files would be processed if the strings were present.
xchangecl +C-B *.pas;*.txt /abc/def/plop//
will replace "abc" with "def", and then "plop" with "", in all *.pas and *.txt files, with case-sensitivity enabled and without creating backups.
xchangecl -d! *.htm !/!\!
will replace "/" with "\" in all *.htm files.
xchangecl -d! *.htm !/!\! a*.pas !1999!2000!
will replace "/" with "\" in all *.htm files, then "1999" with "2000" in all Pascal files starting with A.
xchangecl -t# test.txt /#13##10#//
will replace all carriage-return line-feed pairs with a null string, i.e. remove all end-of-line markers. This will effectively concatenate all the lines in the file into a single line.
XChangeCL is a program for Windows 95, 98, ME, NT4, XP, 2000, 2003, Vista and Windows 7. Sorry, but it won't work on a Mac, Android, or Linux.