Searching Your Document


In this exercise, you will perform a simple search to find and replace words in the text of a document.

1.

Open the index.html file from the Lesson_17_FindReplace folder. Select the word Sanga within the header Welcome to Yoga Sanga.

This document refers to Yoga Sanga throughout the text, when it should actually be Yoga Sangha. You'll replace that text in this exercise.

2.

Choose Edit > Find and Replace.

The Find and Replace dialog box opens.

Tip

Selecting a portion of text before opening the Find and Replace dialog box automatically causes the selected text to appear in the Search For text field.

3.

In the Find In menu, choose Current Document. In the Search menu, choose Text. Ensure that the Find text field has the highlighted text of Sanga. In the Replace text field, type Sangha. Uncheck the boxes for four options (Match case, Match whole word, Ignore whitespace, Use regular expression).

Find In Current Document, which searches the entire document, can be used only from a single document while it is open. The Find In menu also has five additional options:

  • Selected Text: Searches what you have selected in the current document.

  • Open Documents: Searches all files that are open.

  • Folder: Allows you to browse to select a folder and search all the contents of that folder.

  • Selected Files In Site: Searches files you have selected in the site panel.

  • Entire Current Local Site: Searches the active site.

There are four options at the bottom of the Find and Replace dialog box:

  • Match case: Limits the search to the exact case of the words. If the Match Case box is checked, a search looks only for content that exactly matches the capitalization you used in the Find text field.

  • Match whole word: Matches only complete words.

  • Ignore whitespace: Ignores all spacesif this is checked and you are searching for two words, Dreamweaver also finds all instances in which those two words have additional spaces between them.

  • Use regular expression: Provides patterns to describe character combinations in the text. Use this option to select sentences that begin with "The" or attribute values that contain a number.

4.

Click Find Next.

The first occurrence of the word after the insertion point is highlighted.

5.

Click Replace.

The word is changed to Sangha and the next occurrence of the word is highlighted.

Note

When replacing text in your document, it is recommended that you click Replace first and check the new text to make sure you typed the correct information in the Replace field; then use Replace All after you verify the search criteria and results.

6.

Click Find All.

The results of the search are found and displayed in the Results paneleight more instances of the text for which you searched. Double-clicking an item in this list highlights the instance in the Document window. Using the Find All option allows you to review all instances of the text.

7.

Click the green arrow on the left of the Results panel.

The Find and Replace dialog box opens again.

Dreamweaver remembers the settings from your most recent search. If you close and reopen the dialog box, the text and options you set the last time the dialog box was open are still there. The Find text field should contain Sanga and the Replace text field should contain Sangha.

8.

Now click Replace All on the Find and Replace dialog box.

The Find and Replace dialog box automatically closes after it finishes searching for and replacing text. The status bar of the Results panel reports the number of items found and replaced in your document.

9.

Click the Options menu in the upper-right corner of the Results panel and choose Clear Results; then close the Results panel (Macintosh) or collapse the Results panel (Windows). Save the index.html document.

Leave this file open for the next exercise.




Macromedia Dreamweaver 8(c) Training from the Source
Macromedia Dreamweaver 8: Training from the Source
ISBN: 0321336267
EAN: 2147483647
Year: 2006
Pages: 326

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net