Find in Files

From Appmethod Topics
Jump to: navigation, search

Go Up to Search Menu


Search > Find in Files    Shift+Ctrl+F

Search > Cancel Find in Files (during a search in progress)

You can search for strings in files in specified folders.

Item Description

Text to find

Enter the string you want to locate, or click the DOWN ARROW key to select from the previously entered search strings.

Case sensitive

Differentiates uppercase from lowercase when performing a search.

Whole words only

Searches for entire words only. If unchecked, the search string might be found within longer words.

Regular expressions

Recognizes regular expressions in the search string. See Regular Expressions.

Search all files in project

Searches all files in the open project.

Search all open files

Searches files that are currently open.

Search all files in project group

Searches files in the current project group.

Search in directories

When selected, enables the Search Directory Options, and the search proceeds through files in the specified directories.

File mask

Specifies the files to be searched. The file mask matches the file name only, not the directory name.

  • To search multiple files, use a wildcard entry.
  • To enter multiple masks, separate the masks with semicolons (such as *.cpp;my*.hpp).
  • To search for files in the product root directory, specify the root directory using the appropriate environment variable (see Tools> Options > Environment Options > Environment Variables).

To enable this field, click Search in Directories.

Directories

Specifies the directories and directory groups to be searched in.

  • Use the associated BrowseForFolder.bmp Browse for Folder button to browse for the directory to search.
  • Use the associated FoldersAndGroups.bmp Folders and Groups button to browse for directories and to create directory groups.
  • You can explicitly enter directories and directory groups in which you want to search.
    • Directory group names are preceded by an at sign (@), such as @mydirgroup.
    • To specify multiple directories, separate entries with semicolons (;). For example, C:\foodir;C:\bardir;@mydirgroup.

To enable this field, click Search in Directories.

BrowseForFolder.bmp Browse for Folder

Invokes the Browse for folder dialog box, which enables you to locate and select a directory to search.

FoldersAndGroups.bmp Folders and Groups

Invokes the Select Directories dialog box, which enables you to do the following:

  • Create a named directory group and select the directories to belong to that group.
  • Create a list of directories and directory groups in which to search.

Include subdirectories

Searches subdirectories of the directory paths specified.

Display results in separate tab

Causes the results of each search operation to be displayed in a new search tab in the Messages view. The tab is labeled Search for <string>, where string is the text you have searched for.

  • If it is checked, then a new search tab is created after each search operation even if one already exists.
  • If it is not checked, a new search tab is created unless one already exists.
  • If it is not checked and if a search tab already exists, the search results are placed in the existing search tab and its label is changed.

Group results by file

Lists individual files that contain search matches with search results listed for each file.

Using Find in Files

For each occurrence of a string, the filename is listed in the Messages View at the bottom of the Code Editor, and the hit count (the number of occurrences found in the file) is appended to the filename. For example:

FindInFiles.png
  • To display the lines in a file that contain the search string, either double-click the filename or click the + sign. All the lines that contain the string are displayed, along with the line numbers. For example:
DBXCommon.pas(1664): property OnError: TDBXErrorEvent read GetErrorEvent write SetErrorEvent;
  • To move to a specific line in the file, double-click the line in the Messages View.
  • To repeat the last search, right-click the Messages View and select Repeat Search.
  • To stop a search in progress, do either:
    • Right-click the search result tab for that search and choose Close Tab.
    • Choose Search > Cancel Find in Files.
While a lengthy search is in progress, the Find in Files command changes to Cancel Find in Files.

See Also