|
|
|
2003 TextMaestro Technologies
|
Example 15
|
Example 18: Multi-file Find-and-Replace. Have you ever wished that you could see all find-and-replace instances before you actually perform the replacement? And, sometimes even skip some of the instances, or even hand-edit some of them? Now you can with TextMaestro. Fear no more when you perform a massive find-and-replace in multiple files under batch mode. Because you can preview your act before you actually submit the replacement.
Let us begin with an example. Suppose we want to preview instances of all .gif images in a set of .html files. Here is the step by step process. We will discuss:
1. Preparation and Previews: Top (1) Launch the application. (2) Drag the .html files of interest onto the list view as shown below. (3) Click on Text
Conversion
Make sure the .html files on the list view are all selected, if they are not.
Batch Text Conversion dialog will appear as shown below. Alternatively, simply hit Ctrl+Shift+F. (See 13: Text Conversion in Batch mode for details on various controls found on this dialog).
(4) Before you do anything here, you must set up a library. Hit the Library
We use left and right Add
(5) Hit Search
in files using macros in library
Expect to see the following:
Files marked with
2. Meanings of Instance Icons: Top Various icons are used for instances (right list above). They have certain meanings. They are listed below. For all cases however, note that alternate colors (blue and red) are used to distinguish instances from one macro to another macro. Here is an example. Suppose the library contains 3 macros. (In our example we had only one macro). Also suppose, for a certain file, first macro generated 8, second macro 7 and third macro 6 instances. Then the right list will display total 21 instances, where first 8 instances will be in blue icons, next 7 in red icons and the last 6 in blue icons again. Since our library here had only one macro, we saw only one color (blue) icons. Various Instance Icons:
3. Overrule Instances: Top Consider the above example. Note samples.htm file has four instances. At this stage if you proceed to write the preview results to some files, these four instances will be written as you seem them. However, what if you want to skip the second instance, and make some last minute changes in the fourth instance? This type of skip or last minute modification is commonly called overruling the preview. To skip an instance, simply click on it and hit the
skip To modify an instance, simply make changes in the
Find and Replace Preview window (a secondary window pops up as you click
on an instance), and hit on Save
changes Suppose we marked the 2nd instance as skipped, and 4th as modified. Expect to see the following:
4. Write Results to Files: Top After the preview instances are constructed, you can write the results to files, if you choose to. However, you must specify names for output files first. Here are the steps:
At this point if you hit Write
to files Here is the message from Message Window.
|