Finding and Replacing Content Within Files
From the Current Directory browser, you can search for a specified string within files. If the file is open in the Editor, you can replace the specified string in a file.
Finding a Specified String Within a File
To search for a specified string in files:
- Click the find button in the Current Directory browser toolbar.
- The Find dialog box appears. This is similar to the Find & Replace dialog box in the Editor.
- Complete the Find dialog box to find all occurrences of the string you specify.
- Type the string in the Find what field.
- Select the directories or files to search through from the Look in listbox, or type a directory name directly in this field. If documents are open in the Editor, you can select those files and related files.
- Constrain the search by checking Match case or Whole word.
- Select Subdirectories if you want the search to also look through the subdirectories. Also select this if you want to find files in private directories or method directories (those that start with
- Results appear in the lower part of the Find dialog box and include the filename, M-file line number, and content of that line.
- Open any M-file(s) in the results list by doing one of the following:
- Double-clicking the file(s)
- Selecting the file(s) and pressing the Enter or Return key
- Right-clicking the file(s) and selecting Open from the context menu
- The M-file(s) opens in the Editor, scrolled to the line number shown in the results section of the Find dialog box.
- If you perform another search, the results of each search are accessible via tabs just below the current results list. Click a tab to see that results list as well as the search criteria.
Function Alternative. Use
lookfor to search for the specified string in the help in all M-files on the search path.
| || Opening, Running, and Viewing the Content of Files|| ||Replacing a Specified String Within Files |