Find Text in Disk Files

Contents  Previous  Next

 

Menu: Search > Find Text in Disk Files

 

Default Shortcut Key: none

 

Macro function: FindTextInDiskFiles()

 

The Find Text in Disk Files command provides the ability to search for a text string across a specified range of drives, directories and files.  Lines which contain the desired string are presented in a results window, and the file containing a match can be opened by pressing Enter or double clicking on the line.

 

Regular Expressions can be used when specifying the search string, and one or more file patterns can be used to search within an entire class of files.

 

The results window is non-modal, so you can peruse the files opened and later return to the window to open other files, without losing the search results.  The results window has a Copy All button which allows its results to be copied to the current clipboard.  The Copy Selected button will copy only those lines that have been selected. The Open All button will automatically open all files in which matching lines were found.

 

A wide range of options are provided to control how the search is conducted, and what drives, directories and files should be searched:

 

SearchFindTextInDiskFiles

 

Disk drive to search on

This drop-down list allows you to specify the disk drive to be searched.  When the Search all drives and directories checkbox is selected, this list is disabled.

 

Directory to search in

This drop-down list allows you to specify the directory to be searched.  When the Search all drives and directories checkbox is selected, this list is disabled.  Note that a double-click is required to select a directory; a single-click will not suffice.

 

bm1Use the folder icon with the red square in it to jump to the directory of the current file.

 

File(s) or file pattern(s) to search within

This edit box allows you to specify the filename and/or file pattern(s) to search within.  A list of common file patterns has been supplied in the drop-down list, or you can type your own. When specifying multiple patterns, separate the patterns with a semi-colon (;) and do not use intervening spaces.

 

bm2The file patterns that appear in the drop-down list are shared with the File Open dialog.  The file patterns which appear in this dialog are user-definable via the Configure | Preferences | File I/O options page.

 

bm2Regardless of whether or not such files match the supplied filename(s) or file pattern(s), binary files will not be searched by this command.

 

Text to search for

This edit box is used to specify the text string to be found.  Regular Expressions can used if desired.  The associated drop-down list can be used to recall previous search strings.

 

bm1The Delete key can be used while the drop-down list is displayed to delete the selected entry from the history list.

 

bm1Special characters can be entered into the Text to search for edit box using the technique described in the Help topic Inserting Special Characters.

 

Insert Tab

Use this button to insert a tab character into the Text to search for edit box.

 

Ordinarily, the Tab key is used to move from field to field within a dialog box.  If you would prefer that the Tab key insert a tab character in this dialog box, and in other Find/Replace related dialog boxes, check the relevant box on the Configure | Preferences | Tabs dialog page.

 

Sort List

If this box is checked the history list will be maintained in alphabetic order, rather than in the order the strings were entered.

 

bm2When switching to an alphabetically sorted list, the chronological ordering of the list will be lost, and cannot be restored by unchecking the checkbox.

 

File Search Options

Search all drives and directories

If this option is selected all drives and subdirectories will be searched, except that removable drives may be exempted using the option below.

 

Ignore removable drives

If this option is selected drives with removable media (such as floppy drives and mass storage cartridges) will not be searched.

 

Search subdirectories

If this option is selected all subdirectories below the selected directory will also be searched.

 

Consider Hidden bit files

If this option is selected, files whose Hidden attribute bit is set will be considered during the search.  The Hidden attribute causes a file to become invisible to many directory listing programs, and is often used together with the System file attribute.

 

Consider System bit files

If this option is selected, files whose System attribute bit is set will be considered during the search.  The System attribute is sometimes used by the operating system to distinguish files which should not be altered or deleted.

 

Consider Archive bit files

If this option is selected, files whose Archive attribute bit is set will be considered during the search.  The Archive attribute is used by the operating system to flag those files which have been changed since the previous backup operation.  Backup programs will typically reset a file's Archive bit after saving the file to a backup device.  In most cases you will want to leave this checkbox active to ensure that recently changed files will be searched.

 

Stop searching after n matches are found

Use this option to stop the search after a specified number of matches have been found.

 

Scope

Search within the file set specified to the left

Use this option to search a file set which has been designated in the disk, directory and file controls at the left side of the dialog.

 

Search within all open files

Use this option to restrict the search to those files that are currently open for editing.

 

Search the active project

Use this option to limit the scope of the Find operation to those files within the active project.

 

Text Search options

Perl regular expressions

If this box is checked, wildcard characters within the search string will be interpreted according to the Perl-Compatible Regular Expression (PCRE) convention.  In part, this means that the asterisk (*) will cause a match of zero or more occurrences of the preceding character.  The period (.) will match any single character. For more information, see Regular Expressions.

 

Maximal matching

When using pattern matching characters, there can sometimes be more than one text string that matches the search string. This option can be used to request that the longest possible matching string be returned.

 

Match case

This option can be used to force the search string to be matched exactly. When unchecked, a case insensitive search is performed.

 

Match whole words

This option can be used to restrict matches to those strings which appear as a whole word.  The characters which serve to delimit words are user-configurable; see Configure | Preferences | Cursor Travel.

 

Match at start of line

This option can be used to force the search string to be matched only when a matching string appears at the start of a line.  This effect can also be achieved with a Regular Expression.

 

Match at end of line

This option can be used to force the search string to be matched only when a matching string appears at the end of a line.  This effect can also be achieved with a Regular Expression.

 

Report Options

Show matching files/lines

If this option is selected, the text of the matching lines will be shown in the results window, grouped by file.

 

Show matching files

If this option is selected, the filenames in which matching lines occurred will be reported, but the matching lines will not be shown..

 

Show files that do not contain the search text

If this option is selected, the filenames in which matching lines do not appear will be reported..

 

Show line numbers

If this option is selected, line numbers will be displayed to the left of each matching line.

 

Show count of matches

If this option is selected, the count of matches found in each file will be shown in the results window.

 

Show divider bars

If this option is selected, divider bars will be used within the results window to separate one file's matches from another.