A common task performed by XReplace-32 macros is to run a replacements on a variable set of files using the same replacements
grid. For example, an XReplace-32 user manages a web site, which is stored in c:\www.
We would like to replace http://www.foo.com
by
http://www.foo.net
.
We have first created and saved a replacements grid with a single row:
http://www.foo.com
replaced by http://www.foo.net
.
The file is called foo.rpl.
Then, we have created a new macro (comments start with #):
# change directory to c:\www
cd c:\www
# set the filter to *.htm
filter_set *.htm
# make sure the tagged files list is empty
removeall
# drag and drop files
dirdragdrop
# load the foo.rpl file saved into c:\xreplace
grid_load c:\xreplace\foo.rpl
# make sure the whole words only option is off
whole_words false
# make sure the case-sensitive option is off
case_sensitive false
# launch the replacements operation
go
|
This macro can be saved and is ready to be used.
With such a macro, all new .htm files uploaded to the site will be parsed and the links will be adjusted.
|
XReplace-32 can do similar tasks in multiple ways. For example, the
filter_set *.htm
and the dirdragdrop
lines could be replaced by a single
wildcard_drop *.htm
command.
|