The Find and Replace feature in RoboHelp allows you to search for (and optionally replace) text, HTML tags, and attributes in the current topic, the current project or across files and folders in a specified path. You can search for text in the HTML editor, indexes, and TOCs in a project. This means that you can search for text in the Index and Table of Contents pods. In addition, the replace functionality allows you to replace the text in these pod.
In the Find and Replace pod, you set the search options. RoboHelp then displays the results in the Find Results pod and also lets you open each modified file in the Find Results Editor pod (HTML view). Also, when you perform the replace operation, RoboHelp provides the option to back up the files in which text replace occurred.
note: The tool works best with text files.
1)Press Ctrl+Shift+F or do one of the following:
•In the Project ribbon, click Find and Replace.
•In the Pods drop-down list of the Project, Edit, or Review ribbons, choose Find and Replace
2)Specify what to find in one of the following ways:
•(Basic mode) Type the text, tag, or attribute that you want to search in the Find What box.note: To find text such as Windows Desktop across multiple lines, type Windows(.|\n)*Desktop and make sure that you select Use Regular Expression.
•(Advanced mode) Click the Advanced Mode icon. Select the filters and specify the text, tag, or attribute for RoboHelp to build a regular expression.
Begins With
Specify phrases, words, or characters that should occur in the beginning of found instances.
Ends With
Specify phrases, words, or characters that should occur in the end of found instances.
Contains
Specify phrases, words, or characters that found instances should contain.
Does Not Contain
Specify phrases, words, or characters that found instances should not contain.
note: In Advanced mode, the Multifile Find and Replace tool performs multiline search.
3)Type the text, tag, or attribute that you want to replace in the Replace With box.
If you want to search without replacing, leave the Replace With box empty.
4)Use the Look In option to search in the following:
Current Project
(Default) Search within the current project.
Current Window
Search in the current topic
Opened Files
Search all files currently opened in RoboHelp.
Path
Search all files in the selected folder path.
note: When searching in a selected path, RoboHelp only searches for files that appear in the File Status pod (Project > Open > Pods > File Status).
5)To confine your search to specific file types within the current project, or the files or folders you have selected in the previous step, use the Files Of Type option.
note: The Find and Replace features works best with text files.
6)(Optional) Use the following options to limit or filter your search:
Match Case
Searches text that exactly matches the case of the text that you want to find. For example, if you want to search for the quick fox, you will not find the The Quick Fox.
Use Regular Expression
Lets you use MS Word-style or UNIX-style expressions to be interpreted as regular expression operators. For more information, see Use Microsoft-style regular expressions.
Use WildCards
Lets you use wildcard characters (such as *,?) to represent one or more characters when you are searching. For example, index* locates all instances of the word index as well as all files that begin with index, like index.doc and index.txt.note: When you use wildcards or regular expressions, the Match Whole Word and Ignore HTML tags options are unavailable to indicate that these options are automatically turned off. You can’t turn on these options.
Match Whole Word
Searches for text that matches one or more complete words. For example, if you enter nation as the search term, you will not find explanation.
Exclude HTML Tags
Searches for a specific text string only in the content, ignoring any occurrence in HTML tags. For example, a search for the string title will only find occurrences of the string in the content and not in HTML tags, such as <title>.
note: If you want to search for attributes, deselect the Exclude HTML Tags option.
7)(Optional) Use the following options while replacing text in files.
Backup Modified Files
Backs up the original files before replacing text
Overwrite Backups
Lets you overwrite existing backups when you select Make Backups
Open Modified Files After Replace All
Opens each modified file in HTML Editor after replacing the text. You can review the changes, undo the changes if required, and save the file.
note: If this option is not selected, RoboHelp saves each modified file after replacing all instances.
8)To search without replacing, click Find All or Find Next.
Find Next
Searches iteratively across files. This implies that if your search found occurrences in multiple files, the first file is opened with the first occurrence of the result selected. If you use Find Next, RoboHelp first navigates over the occurrences within the current file. After all the occurrences in the file are navigated, RoboHelp opens the next file. RoboHelp continues this way across all files that contain occurrences of the search. You can specify the direction of the search as forward or backward.
Find All
Displays all occurrences of the search text or tags in the Find Results pod.
The results of the search are displayed in the Find Results pod. For more information, see Viewing Find results.
9)To replace found text or tags, click Replace All or Replace.
RoboHelp supports various Microsoft-style regular expressions like the following:
?
c?rd finds card and cord
*
r*m finds ram and random
[ ]
[cg]lass finds class and glass
[-]
[c-g]lip finds clip and flip
@
ste@p finds step and steep
For more information, see Microsoft-style regular expressions and these examples available on Peter Grainge'ssite.
The Multifile Find and Replace tool displays the results in the Find Results pod.
To view the Find Results pod, do the following:
1)Select Project > Open > Pods > Find Results.
The Find Results pod displays the files in which the search text appears. The line number and column number help you locate the searched or replaced text in a topic.
Use the following options to navigate and replace quickly:
Search box
Allows you to specify a criterion for searching through the results. The search functionality allows you to search by any field in the result list. This means that you can search by file name, file name, line number, or file path.
View
Displays the contents of the selected file in the browser.
Edit
Opens the selected file in the Find And Replace Editor. If no result is selected, the first match will be highlighted. Otherwise, the selected result is highlighted.
Cancel
Cancels search.
Toggle Scrolling
Toggles between autoscrolling to display the last found match and stopping at the last displayed match.
Replace All
Replaces all instances of the match.