Dfind

Programmers fast text
search tool.
- Dfind
-
- Programmers fast text search tool.
- Features:
- Looking at results
- Viewing options and how to set
- Advanced functions
- Advanced options - Search Multiple
Folders
- Search History
- Miscellaneous features
- Advanced Options - Search
Multiple Strings
- Example of search selections
using multiple folders and multiple strings
- Search/Replace
- Example using Search/Replace
- Search/Replace Backup files
- Archive example
Features:
- Fast (optimised)
- Can search files not available otherwise - eg Delphi can search
project and Form files
- Will skip binary files automatically
- Several ways to view files found
- Search/Replace function
- Can search filenames as well
- Can search within results also
- Search multiple folders - standard sets can be used
- Google type find option - can find several words which can be in any
order in a line but all have to be present
- Search for multiple strings
- Search/Replace multiple strings
- At present finds Ansi text files only, not unicode (most programming
files, SQL scripts, VS Files etc are Ansi text unless special characters
are used). This limitation will be removed soon.
Folders - The current button selects the current folder, the Browse
button allows you to choose a folder
Looking at results
You can search for any text within results using CTRL+F and
F3 for Find Next
In the results, CTRL+N jumps to the next file, CTRL+P to the
previous file
You can view a window of 10 lines around the highlighted line. Press
CTRL+W to toggle this window on and off

You can view the entire file of the highlighted line. Press
CTRL+V to toggle this window on and off
(This shows part of the file viewer on the right over the results
window on the left. Normally the file viewer will fill the
screen).
You can Double-click any line of the file and depending on what is
set as the Viewer for that file it will open with this.
Viewing options and how to
set
If there is no action defined for this file type, the program will
ask how to open the file

Possible options you can set up for any file extension/file type
are:
ASK Asks how to open the file
WINDOWS using the windows default program to open the file
VIEWER uses the built in file viewer
Notepad
Notepad++ and EditPlus can alos be used if installed - you need to
set where installed to and the advantage of these programs is they will
position the cursor at the exact part of the file
These can be set in the ini file - for example:
[Viewer]
TXT=Notepad
BAT=E:\JBData\Programs\EditPlus4\Editplus.exe
XML=E:\Utilities\Programs\Notepad++.exe
PAS=E:\JBData\Programs\EditPlus4\Editplus.exe
BAK=ASK
LST=Viewer
Advanced functions
The "Advanced" check box at the top of the screen turns on a few extra
facilities:
More than one folder can be searched
Multiple strings can be searched
The button at the end of each selection can add more advanced functions
The extra options tabs are:
Search filenames by date and time - you can select only files that were
created or modified in a date range
Options for View Window - if you are looking up a file where a
non-proportional font looks better then use this option
and also the default is to allow searching files that may be in use -
select the other option (Standard LoadFromFile) to skip in use
files.
Advanced options - Search
Multiple Folders
- You can set multiple folders to search (up to 10 folders)
- Each folder in a set can be set to be included (or not) in the next
search using a checkbox next to each
- A set of folders can be saved as a default set
- In this example, a set of 5 folders has been saved, but only one (the
checked folder) will be used for the next search.
Search History
- Each individual string searched for in a session is saved into a
history
- you can choose it again from the history.
Miscellaneous features
- Top right are 2 useful buttons
- a up and down arrow sets button the window to use the whole screen
vertically
- a summary of tips
- If you have longer lines you can stretch the window wider
- If you alter the search string or folders or filespecs, the previous
search counts will turn grey to show they are not for the current search
parameters
- There is a stop button while the search is underway - hitting that
will show the results found so far.
- The "Faster" option turns off displaying the results until the search
is complete or stopped. This speeds the search a lot.
(You see counts only while running)
Advanced Options - Search
Multiple Strings
- You can enter one string to search for in the edit box on the main
screen
- or you can search for multiple strings using the advanced button at
the end and choosing "Multiple strings"
- (These are not saved into the history)
- You can load a set of multiple search strings from a file
Example of search selections
using multiple folders and multiple strings
Search/Replace
- You can search and replace one string with another
- There are options whether match has to be whole word or not, and
whether case sensitive
- Each time you select the Replace option you have to check the Replace
option - this is to prevent running it by accident.
- There is an option whether to approve each changed line in a file -
i.e. you can accept some changed lines and reject others
- The altered lines are shown before saving, and you can use a
difference program (such as WinMerge or Beyond Compare) to check if the
changes are OK.
- You can search and replace multiple strings as well (this option is
new with V6).
- If you use the Replace function you should install a Differences
Viewer such as WinMerge, Beyond Compare (etc) and set this in the Setups
- Example: DifferencesViewer=D:\Utilities\WinMerge\WinmergeU.exe
- This will show differences between original file and altered file
before saving/overwriting the original.
- Note any files with the text DfindSearchReplace in the filename can be
searched, but are skipped for Replace operations.
- This is to avoid Dfind temporary replace files and logs being
altered!
- You can create a list of strings to load from a file, each line has
the old text and the new text separated by a TAB character.
- Example of 3 lines in a file:
- oldword1<TAB>newword1
- oldword2<TAB>newword2
- oldword3<TAB>newword3
- The maximum number of multiple strings is 200 at present.
- If you create a list of strings to load from a file, call it something
like "ListOfStrings1-DfindSearchReplace.txt" so it will not be altered
with Search and Replace - any filename with DfindSearchReplace in the
filename is skipped.
- Make note of the backup files and change log made when files are
altered
- This is a new feature and because it can change files -
use with great care and keep backups.
Example using Search/Replace
Selection screen

Examples of Search/Replace running, with query about replacing a line
When changes are completed for a file, the screen below is seen - this
shows the changed lines for the file.

Before you decide to save the file or not, it is strongly recommended you
use the Show Differences option:
This provides a cross check that the changes will be as you
expect. Note you can do this check before you elect to
overwrite the original file with the changes.
Search/Replace Backup files
There are several ways that Search/Replace changes are tracked
- Any file replaced (e.g. called file1.txt) has a backup file with name
like file1-DfindSearchReplace-20180826-093500-bak.txt (The
numbers are the date and time the file was replaced)
- Changes made are logged into a log file with name
DfindSearchReplace.log. This file is in the folder that the
searches start from. This log file shows details just of
which lines were changed.
- Any files replaced are archived in original form into an archive file
in the same folder as the program - called
DfindSearchReplaceArchive.jarc. This file is a text
archive of each original file with headers at the stop and end of each
file with information on the file name, date and time, and size etc.
- This archive can be used to recover files if needed by opening in an
editor, searching for the filename and copying and pasting the file
contents if required.
- There may be several changed versions of any one file in the archive,
so you will want to check the headers and date and time to get the
version you want.
Archive example
-<<<< Dfind Archive
>>>>-
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><1
Archived:26-Aug-18 ~ 19:06:47 ~ Lines=506 ~ Size=21663 ~
E:\JBData\Test Long with Spaces\Replace2.txt ~ Changes=3 ~ 17-Apr-18
13:07
size=21663<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><2
(complete file contents of
Replace2.txt before changes are here)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><3
Archived:26-Aug-18 ~ 19:06:47 ~ Lines=506 ~ Size=21663 ~
E:\JBData\Test Long with Spaces\Replace2.txt ~ Changes=3 ~ 17-Apr-18
13:07 size=21663
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><4
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><1
Archived:26-Aug-18 ~ 19:12:55 ~ Lines=490 ~ Size=20170 ~
E:\JBData\Test Long with Spaces\Replace3.txt ~ Changes=7 ~ 18-Apr-18
12:07 size=20170
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><2
(complete file contents of
Replace3.txt before changes are here)
This Header information repeats at the beginning and end of the file -
followed by the next file archived