External Editors

Internal Context Viewer

By default the program uses an Internal Context Viewer to display the context of search hits when you double click on a hit line. As of v 4.6 the program can use the viewer/editor specified in the Text Files section below instead of the internal viewer. See External Context Viewer for more information.

Text Files

Search and Replace can launch a text viewer/editor of you choice on an item in the Search Results list via the ‘Open with Default Viewer’ function under the View Menu or the right click context menu.

The command line to launch the default viewer is configured in the ‘If no association use’ field in Options-General. The program defaults to using ‘notepad.exe’. You can modify this to employ another program.

Two special switches are available: %line% and %path%. %line% will pass line number in the file where the search hit is found and %path% is the full path to the file highlighted in the search results list.

Consult the documentation for your viewer/editor for the command line switches that are understood by your program. It surely understands a file path for the file to open. However, not all programs have a command line switch for ‘line to move to’ upon opening a file.

Here are some settings for a few popular text editors.

1. TextPad (Helios Software, www.textpad.com):

C:\Program Files\TextPad 5\TextPad.exe %path%(%line%,1)

2. Multi-Edit v 8.0 (American Cybernetics, www.multiedit.com)

C:\Program Files\Multi-Edit8\MEW32.exe %path% /L%line%

3. UltraEdit (IDM Computer Solutions, www.ultraedit.com):

“C:\Program Files\UltraEdit\UEDIT32.EXE %path%/%line%”

Note: The UltraEdit command line may require surrounding ” characters as modeled above. If your version of UltraEdit does not move the line highlighted in the Search Results List, try adding, or remove, surrounding “‘s.

4. Notepad++ (Sourceforge.net – notepad-plus.sourceforge.net/uk/site.htm)

C:\Program Files\NotepadPlus\notepad++.exe -n%line% “%path%”

 

Binary Files

IMPORTANT: See Word Document Notes for critical information about replaces in binary files such as .doc, .xls, mdb, .gif, .pdf, .exe, etc.

Binary Search Results
Search & Replace binaryresults2 External Editors

If Search and Replace determines that the file being searched is a binary file the Search Results list switches to displaying ‘offset’ information as shown in the image below. If you have our freeware FSHED – Funduc Software Hex Editor installed on your computer, double clicking on a line in the Search Results will use FSHED to display the hit context.

You can configure the program to use a hex/viewer of your choice in the Options-General ‘Binary Editor’ field. Consult the documentation for your editor for the command line switches available for your program. Here are some example settings (lines will word wrap):

1. Hex Workshop (BreakPoint Software, www.bpsoft.com):

hworks32.exe “%path%” /GOTO:%start% /SELECT:%length%

Note: The /SELECT:%length% section can be removed if you don’t want the selection found by Search and Replace to be highlighted when Hex Workshop launches. Remove /GOTO:%start% if you don’t want Hex Workshop to jump automatically to the offset. You can add the switch /READONLY if you want.

2. FSHED – Funduc Software Hex Editor – a freeware hex editor we created. You can download a copy from the FSHED page on our web site.

fshed.exe “%path%” /s%start% /l%length%

3. HexView, an older hex viewer by Funduc Software:

hexview.exe “%path%” -S%start% -E%end%

External Editors