Categories


Popular topics

Line 5: Line 5:
  
 
[[File:Ultraedit find in files.png|right]]
 
[[File:Ultraedit find in files.png|right]]
Find in files allows you to search for a string in multiple files in a location of your choosing. The files don't have to be open in UltraEdit.
+
Find in files allows you to search for a string in multiple files in a location of your choosing. The files don't have to be open in UltraEdit. The results of the search are written to the output window, unless you have checked the '''Results to edit window''' advanced setting. You can double-click results in the output window to open the file and immediately jump to the match location in UltraEdit.
  
 
Enter the string to search for in the '''Find what''' field, which allows a single or multi-line string up to 20,000 bytes.
 
Enter the string to search for in the '''Find what''' field, which allows a single or multi-line string up to 20,000 bytes.
Line 12: Line 12:
  
 
You can specify the search location(s) in the '''Directory''' field. This field may contain multiple search paths separated by semicolons, i.e.: ''C:\mydir1\; c:\mydir2\''.
 
You can specify the search location(s) in the '''Directory''' field. This field may contain multiple search paths separated by semicolons, i.e.: ''C:\mydir1\; c:\mydir2\''.
 +
 +
[[File:Ultraedit find i current dir.png|left]] Click the '''active file directory''' button to set the '''Directory''' field to the active file's parent directory. Click the '''...''' button to open a folder browser where you can browse to and select your target search directory.
 +
  
 
The '''In files/types''' field allows you to restrict the search to particular file types by extension. For example, to search only HTML and CSS files, you would use: ''*.html;*.css''. If left empty, all files are searched.
 
The '''In files/types''' field allows you to restrict the search to particular file types by extension. For example, to search only HTML and CSS files, you would use: ''*.html;*.css''. If left empty, all files are searched.
Line 18: Line 21:
  
 
Use the '''In''' setting to set the search area to one of the following:
 
Use the '''In''' setting to set the search area to one of the following:
* '''Files listed''' will search all files in the directory you specify)
+
* '''Files listed''' will search all files in the directory you specify, respecting the  '''In files/types''' filter
* '''Open files''' will search all files open in UltraEdit)
+
* '''Open files''' will search all files open in UltraEdit (the '''In files/types''' and '''Directory''' fields are ignored)
* '''Favorite files''' will search only [Favorite files]
+
* '''Favorite files''' will search only [Favorite files] (the '''In files/types''' and '''Directory''' fields are ignored)
* '''Project files''' will search all files in the open project (this option is disabled if no project is open)
+
* '''Project files''' will search all files in the open project (this option is disabled if no project is open)  (the '''In files/types''' and '''Directory''' fields are ignored)
 
   
 
   
 
[[File:Ultraedit find i history.png|left]] '''History button'''<br>
 
[[File:Ultraedit find i history.png|left]] '''History button'''<br>
Line 43: Line 46:
 
[[File:Ultraedit find i regexp.png|left]]'''Regular expressions help button'''<br>
 
[[File:Ultraedit find i regexp.png|left]]'''Regular expressions help button'''<br>
 
This button opens a short regular expression syntax reference for the selected regular expression engine.  This button is subdued unless the regular expressions checkbox is checked.
 
This button opens a short regular expression syntax reference for the selected regular expression engine.  This button is subdued unless the regular expressions checkbox is checked.
 +
 +
'''Find'''<br>
 +
This button starts the find in files search. When find in files is running, the "Find / replace in files" option in the ribbon changes to "Cancel / replace in files." You can click this option to cancel the running search.
 +
 +
==Advanced search options==
 +
'''Match whole word'''<br>
 +
This option forces the search to match whole words only. This is useful, for example, if you need to search for 'a', or 'A' without finding all words including 'a'.
 +
 +
'''Match case'''<br>
 +
This option forces the search to match the case of the "Find what" string exactly. This option applies to regular expressions as well.
 +
 +
'''Regular expressions'''<br>
 +
This option enables the use of regular expressions for the "Find what" string. There are 3 different types of regular expressions available:
 +
* '''Perl'''<br> uses [[Perl regular expressions|Perl style regular expressions]] based on the [[http://www.boost.org/doc/libs/1_50_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html Boost C++ Libraries]].
 +
* '''UltraEdit'''<br> uses [[Regular expressions|UltraEdit style regular expressions]].
 +
* '''Unix'''<br> uses [[Regular expressions|Unix style regular expressions]].
 +
 +
For information regarding creation of regular expressions see [[Regular expressions]] or [[Perl regular expressions]] topics.
 +
 +
'''Results to edit window'''<br>
 +
This option will write the results of the search to a new, unsaved file in UltraEdit, instead of the output window. This way, you can edit, save, or print the results. You can right-click on a result in the edit window to open the match/file from the context menu.
 +
 +
'''Match files / lines if string is not found'''<br>
 +
* Setting this to '''Files''' will return as results all files that '''do not''' include the search string.
 +
* Setting this to '''Lines''' will return each individual line in results that '''do not''' include the search string, for all files searched. The '''files''' option only lists files that do not include the search string, but this option returns data on a line-by-line basis.
 +
 +
'''Search subdirectories'''<br>
 +
By default, only files in the top level of the search directory are searched. If this option is checked, all subfolders of the '''Directory''' field search location will be searched, not just the top level files.
 +
 +
'''Ignore hidden subdirectories'''<br>
 +
If this option is checked (along with '''search subdirectories'''), then OS-level hidden subfolders are not searched.
 +
 +
'''Open matching files'''<br>
 +
This option will open all files containing a match.
 +
 +
'''Subdirectories to ignore in search'''<br>
 +
You can exclude certain subdirectories by entering them here. For example, if you want to exclude any folder named ".git," simply type ''.git'' into this field. Separate multiple items with a semicolon, for example, ''.git;cvs''.
 +
 +
'''File names/extensions to ignore in search'''<br>
 +
You can exclude file types or names from the search by entering them here. For example, if you want to exclude from the search all files with an extension of ".bak", simply type ''*.bak'' into this field. Or if you wish to exclude all files with names beginning with the string "index," you could type ''index*'' here (the asterisk acts as a wildcard). Separate multiple items with a semicolon.
 +
 +
'''Use encoding'''<br>
 +
Check this box to manually specify an encoding type UltraEdit should assume when opening files to search them. If this option is left unchecked (recommended), the search will use the default OS encoding for searching files unless a BOM is detected, in which case the encoding signaled by the BOM is used. If this option is checked, the options for are as follows:
 +
* '''Auto-detect''' will attempt to read the first 10 KB (approximately) of each file and automatically detect the encoding. Due to this additional step and processing, this may impact performance of the search.
 +
* '''Active file''' will use the active file's encoding for all files searched.
 +
* Beyond the above two options, you can manually set a specific encoding type to use for the search. The encoding type you select will be used for all files searched. This list is populated from the list of encodings the OS supports.
 +
 +
Please keep in mind that if the wrong encoding is used for find in files, search results may be inaccurate or incomplete.
 +
 +
<div class="idm-see-also">
 +
See also:
 +
* [[Find]]
 +
* [[Replace]]
 +
* [[Replace in files]]
 +
* [[Find string list]]
 +
* [[Hex find]]
 +
* [[Hex replace]]
 +
</div>

Revision as of 14:42, 10 August 2017

Shortcut: Ctrl+Shift+F

right Find in files allows you to search for a string in multiple files in a location of your choosing. The files don't have to be open in UltraEdit. The results of the search are written to the output window, unless you have checked the Results to edit window advanced setting. You can double-click results in the output window to open the file and immediately jump to the match location in UltraEdit.

Enter the string to search for in the Find what field, which allows a single or multi-line string up to 20,000 bytes.

In addition to regular characters and strings, the Find what field supports searching for several special characters and strings with special notation. For example, "^t" will match a tab. For a complete list of these values, see Special search characters. These special characters are valuable for matching non-printable text in files.

You can specify the search location(s) in the Directory field. This field may contain multiple search paths separated by semicolons, i.e.: C:\mydir1\; c:\mydir2\.

left Click the active file directory button to set the Directory field to the active file's parent directory. Click the ... button to open a folder browser where you can browse to and select your target search directory.


The In files/types field allows you to restrict the search to particular file types by extension. For example, to search only HTML and CSS files, you would use: *.html;*.css. If left empty, all files are searched.

If the Find string is left empty, UltraEdit will return a list of all file names matching the other search settings. This can be useful in generating a directory listing.

Use the In setting to set the search area to one of the following:

  • Files listed will search all files in the directory you specify, respecting the In files/types filter
  • Open files will search all files open in UltraEdit (the In files/types and Directory fields are ignored)
  • Favorite files will search only [Favorite files] (the In files/types and Directory fields are ignored)
  • Project files will search all files in the open project (this option is disabled if no project is open) (the In files/types and Directory fields are ignored)

left History button
This button displays a scrollable find history list.

left Favorites button This button opens the search favorites menu with the following options:

Add to Favorites adds current item in "Find what" field to Favorites list
Edit Favorites opens Edit Find/Replace Favorites dialog where you can name favorite search strings, organize the list and remove items from the list
Favorites opens sub-menu to select an existing favorite for the "Find what" string

leftRegular expressions help button
This button opens a short regular expression syntax reference for the selected regular expression engine. This button is subdued unless the regular expressions checkbox is checked.

Find
This button starts the find in files search. When find in files is running, the "Find / replace in files" option in the ribbon changes to "Cancel / replace in files." You can click this option to cancel the running search.

Advanced search options

Match whole word
This option forces the search to match whole words only. This is useful, for example, if you need to search for 'a', or 'A' without finding all words including 'a'.

Match case
This option forces the search to match the case of the "Find what" string exactly. This option applies to regular expressions as well.

Regular expressions
This option enables the use of regular expressions for the "Find what" string. There are 3 different types of regular expressions available:

For information regarding creation of regular expressions see Regular expressions or Perl regular expressions topics.

Results to edit window
This option will write the results of the search to a new, unsaved file in UltraEdit, instead of the output window. This way, you can edit, save, or print the results. You can right-click on a result in the edit window to open the match/file from the context menu.

Match files / lines if string is not found

  • Setting this to Files will return as results all files that do not include the search string.
  • Setting this to Lines will return each individual line in results that do not include the search string, for all files searched. The files option only lists files that do not include the search string, but this option returns data on a line-by-line basis.

Search subdirectories
By default, only files in the top level of the search directory are searched. If this option is checked, all subfolders of the Directory field search location will be searched, not just the top level files.

Ignore hidden subdirectories
If this option is checked (along with search subdirectories), then OS-level hidden subfolders are not searched.

Open matching files
This option will open all files containing a match.

Subdirectories to ignore in search
You can exclude certain subdirectories by entering them here. For example, if you want to exclude any folder named ".git," simply type .git into this field. Separate multiple items with a semicolon, for example, .git;cvs.

File names/extensions to ignore in search
You can exclude file types or names from the search by entering them here. For example, if you want to exclude from the search all files with an extension of ".bak", simply type *.bak into this field. Or if you wish to exclude all files with names beginning with the string "index," you could type index* here (the asterisk acts as a wildcard). Separate multiple items with a semicolon.

Use encoding
Check this box to manually specify an encoding type UltraEdit should assume when opening files to search them. If this option is left unchecked (recommended), the search will use the default OS encoding for searching files unless a BOM is detected, in which case the encoding signaled by the BOM is used. If this option is checked, the options for are as follows:

  • Auto-detect will attempt to read the first 10 KB (approximately) of each file and automatically detect the encoding. Due to this additional step and processing, this may impact performance of the search.
  • Active file will use the active file's encoding for all files searched.
  • Beyond the above two options, you can manually set a specific encoding type to use for the search. The encoding type you select will be used for all files searched. This list is populated from the list of encodings the OS supports.

Please keep in mind that if the wrong encoding is used for find in files, search results may be inaccurate or incomplete.

MediaWiki spam blocked by CleanTalk.