Using Find And Replace

FAR find and replace is a very powerful text search and replacement tool. HTML editors like FrontPage will break a line unexpectantly at a space character. This usually makes search and replace difficult but FAR takes these random line breaks into account.

Lets say we want to perform a search and replace on an entire FrontPage web. First you would set the Drop File Filter to Skip _vti* folders, so we don't get this bogus web FrontPage web files, and Only Include *.ht* files, so that we only work with HTML files. Now we can drop our webs root folder onto FAR and we will end up with a list of all HTML files.

Example 1: Simple Search

To perform a simple search you must display the Find & Replace panel.  To do this either click the "Find Text" toolbar icon or check the menu item "View > Find & Replace Panel". Enter the text to search for and click the Start button. To replace the found text check the Replace checkbox and enter the replacement text. If "Prompt Mode" is checked then you will be prompted before any replacements are done and have the chance to skip the change.

Tip: The "Ignore CR LF Chars" and "Ignore Multiple Spaces" should be checked if working with HTML files. They compensate for the way HTML editors break lines at space characters and treat multiple spaces as a single space. FAR will find text in HTML files that cannot be found by other find and replace programs.

Tip: Once you have completed your search, click the "Matches" column heading to sort all search so they are together. You can also right click a file item to view its contents.

Example 2: Advanced Search

Use "Commands > Advanced Find & Replace" menu item (File Utilities Mode) to perform more complex searches.

In the advanced search dialog (above) we have more search options.

Notice the "DOS = UNIX" check box. In HTML Help paths often contain a mixture of DOS and UNIX file separators. Checking this box gives you a match ignoring whether the path dividers are Unix forward-slashes or DOS back-slashes. All slashes are treated the same.

Advanced Searching

Once FAR has found the string you are searching for, you can extract parts of the string into temporary variables $A$, $B$, $C$ and insert these sub-strings back into the replacement string.

< Back Next >