|
Home > FAR > Tour >
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 makes search and replace difficult but
not to FAR which 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 "Commands > Find and 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. Basically 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 "Match"
file list 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 to
perform more complex searches.
In
the advanced search dialog (above) we have more search options.
Notice the "DOS = UNIX" check box. This helps you locate hard
to find paths. Example: In HTML Help paths often contain a mixture of DOS
and UNIX file separators. Checking this box gives you a match even when
you have used the wrong file separators.
Advanced Button
Notice
the Advanced button. 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.
|