Find in Files
The find in files (FIF) dialog controls the capability of an application to find text strings within arbitary groups of files on disk. The dialog is shown below;
The FIF dialog offers a variety of comboboxes for controlling various parameters. We'll look at these in detail as we go forward, but the notable point is that these comboboxes all offer history and reversion. Such features of the FIF dialog are identical to those of the search dialog.
Both the search and replace capabilities operate on the current document. By contrast, FIF aims to trawl both files that are already open in the application, including the current document, as well as those that are not.
On a hard drive, there are potentially millions of files. To find specific text within, FIF must open each file in turn and scan through. This is potentially a time consuming operation even on a powerful computer. It is important then, to constrain the search wherever possible, and minimise the number of files that must be searched. The majority of the options provided in this dialog are associated with implementing such a constraint.
Another significant difference between FIF and search or replace, is that the actual search occurs in the background. With both search and replace, during the time when the action is taking place, it is not possible for a user to otherwise work on their documents. In the case of search and replace this is not usually a significant problem. Since those processes are limited to a single document, the time period that they run is fairly limited.
In some cases a tight constraint for FIF is undesireable, the sought text might really be anywhere. In these cases FIF can take many seconds to complete it's work. For this reason then, FIF works in the background. Since FIF runs in the background it is possible to continue working with files that are open in the application, whilst the FIF action completes. An application can only run a single instance of the FIF process at any given time. Peculiar to FIF, not only is there a mechanism to initiate, but also to abort. This option is naturally provided as a discrete menu option, rather than on the dialog. Whilst FIF is running, the FIF dialog is not available.
FIF produces output very similar to that of the "list" option in search. A toolbar pane is provided for the search results. Each line on which a match is found is copied to the toolbar pane. In addition to the match data, the filename and character position is output. Double clicking these line entries, causes the the associated file to be opened, and the cursor placed at the position where the match was made.
Leaving aside the issue of constraints for just a little longer, at the bottom of the FIF dialog are the standard options for case sensitivity, word matching and regular expression. These all work identically to both search and replace.
The "In files/type" option allows a constraint to be made on filenames. When the FIF process searches through files, before opening each, it checks the filename against the list provided in this combobox. The specification in this field works in the same way that it would on the command line. Wildcards like * (star) and ? (question mark) are both allowed, and typically *.* will cause FIF to inspect all files. In order to allow more than one file name/type filter to be specifed, filters may be specified with a semicolon separator.
The "Folder List" section of the dialog allows the specification of allowed folders, rather than a constrant, per sé. If there are no folders specified in this section, then no files will be found to search. With this in mind, if all the search paths are deleted, a single entry for "C:\" will automatically be provided. In this sense then, the folder list is a constraint.
The screenshot shows a larger window with the individual paths selected for search, and this is considered to be the folder group. Above is a combobox, which contains a descriptive name that a user can define. This provides the capability to specify a range of different groups, which can then be called up. It saves the need to specify a complete group each time the FIF process is used. To create a new group all that is necassary is to type a new name into the combobox.
If a new group is to be derived from an old one it is quite simple to select the old group, change the overall name, and then make modifications in the list window. This can save the effort of re-entering all the old paths.
Adjacent to the group combobox are a small block of buttons. These buttons allow path entries to be added, removed and ordered in the list window below. The ordering of the paths in the list affects the search order of the paths as iterated by FIF. This can be useful, when dealing with the likelihood of a find. Initially a tight constraint can be made, later a limited extension to the constraint. Overall, without a weak constraint. Clearly the choice of using the extension is up to the user, but preventing the extension, does require use of the "stop find" menu option.
To create a new path entry in the list, it is necassary to click the new folder button. Once done the empty entry appears in the list. By clicking the list entry the path can be modified directly, as text. In addition a small "Choose" button appears during text entry mode, to the right of the selected list item. Clicking this button simplifies path entry by providing a graphical folder list from which the folder can be selected.
Below the folder list the "Search subfolders" checkbox. This checkbox will cause any subfolder found on the listed search path, to be opened and trawled. If this box is not checked then only the explicitly stated paths in the folder group will be searched.
It is possible when using the search group in combination with "search subfolders" to doubly specify a given path. This occurs whenever a parent and child folder are separately defined in the list. A double specification can also occur if the same path appears twice in the folder list. The FIF process automatically reduces all of the possible paths before the process begins. Even when specified, no single file will be searched twice.
The final combo box "Output to", allows specification of the output pane name. At the beginning of this page we saw how the results from FIF are sent to an output tool pane. The actual pane also contains other data from various functions of the application. These data each appear on tabs within the pane. It is then the name of the tab, which is specified in this combo box. Some names used in the tool pane are reserved, and if it is felt necassary to use one of these names, then the user name will be appended with a suitable digit to make it unique. If the selected output pane already exists, then it's content will be cleared when the FIF process begins.
Since some FIF operations can take some time, it is important in some cases to preserve the results of a specific FIF operation. The "output to" combobox provides this facility.
|