Word Document Notes

Also See General Notes

Search and Replace is a very powerful program! It is oriented toward text files such as program code, html code, log files, text documents, etc. However, if you permit it do so, Search and Replace will do search/replaces in any file where your search string is found. It will can also perform replaces in “binary files” such as Microsoft Word™ DOC files, Excel™ XLS files, Access™ MDF database files, Outlook™ .pst files, Corel Word Perfect™ DOC files, Adobe Acrobat™ .pdf files, and so on. Furthermore, Binary Mode search / replace is not a requirement. Readable, ASCII text is almost always present in these types of files. ‘Also in executable program files (.exe’s). If a simple ASCII text string exists in a “binary file”, Search and Replace will find it.

Sample Results – Binary File Being Searched
Search & Replace binres1 shg Word Document Notes

Search-only operations are OK on any kind of file. If you make replacements in a file that Search and Replace detects as a ‘binary’ file and if you did not disable replacement prompts (Options-Replace), a notice message is presented. Use care if you make replacements. Please aware that native &/or proprietary format files such as word processing documents, database files, and spread sheets, contain internal counters that will probably be thrown out of synch if casual replacing is done. If this happens the application that created the file probably will not be able to read it again and your data will be lost. For example, if you find the text “Funduc Software” in a Word doc and replace it to “Funduc Software, Inc”, Word would probably not be able to load the file afterwards.

Unless you are an advanced user, you should only make replaces in ASCII text files only such as .HTM, .RTF, .TXT, .INI, .C, .CPP, .H, etc.

See External Editors for information on configuring your Search and Replace installation to use an external binary editor when your results involve a binary file.

Replaces in most binary files can probably be done safely if you abide by the following rule: Replace strings must be exactly the same length as the search string. For example, ’2000′ can probably be replaced safely with ’2001′ because the strings are exactly the same length.

Be sure to back up your files before you experiment!!!

If you are making replaces that are a different length that the search string you should convert your Word, Word Perfect files (and others) to RTF format before you operate on them. With careful use, you will have good results.

Important .rtf file Notes

.rtf files are plain text but they are specialized files!! Some things you need to be aware of include:

  • Some characters that you see in your word processor do not exist in that same form in the actual RTF file. For example, the À character in a MS Word .rtf may be coded as \\’c1 the .rtf file itself. Write support@funduc.com if you are interested in a conversion script that can be used with the ‘Apply Script‘ function.

  • Line breaks in the .rtf file itself may not match what you see your word processor. For example, line breaks can be present in between two words even though those words are on the same line when you view the document in your word processor. The ‘Ignore Whitespace‘ may be helpful in this regard.

  • Take care that you not to damage RTF code related to formatting. This is similar to working on HTML files. It is your responsibility to make sure RTF (or HTML) code features are not disturbed unintentionally. This is why we strongly advise you keep good back ups of your files. 

If you are working on spread sheets or database files, export your data to ascii form before making replaces that are a different length than the search string. Import your modified data back into your spreadsheet/database afterward.

If you need to make only a few casual replaces in your Word or Excel files, take a look at our Word SR and Excel SR products.

Other notes:

  • Be sure to define a backup path in Options-Replace and experiment on non-critical files.

  • If you are dealing with .doc’s and are unfamiliar with the rtf format, do some simple searches and use the Context Viewer to see the context surrounding your search hit. Also consider using your text editor or file viewer. rtf is similar to html – there are opening & closing codes that you should not disturb except by intention.

  • Begin by doing simple search/replace only. Casual use of regular expressions may cause problems if you inadvertently change closing & ending codes.

  • Check your work by loading your experimental file back into the editor before moving on to important data.

  • Use extra care if you try to modify data related to advanced features or features such as document properties or a query or a formatting item. The ‘same length’ rule noted above may not work.

Word Document Notes