Dfind


Lightning


Programmers fast text search tool

  1. Dfind
      1. Programmers fast text search tool
        1. Features:
      2. Simple Search
        1. Looking at results
        2. Viewing options and how to set
        3. Other Miscellaneous options
        4. Search History
        5. Miscellaneous features
      3. Advanced Search using Multiple Folders, Multiple Filespecs, and Multiple Strings
      4. Search/Replace
        1. Example using Search/Replace
        2. Search/Replace Backup files
        3. Archive example


Download Info

Current Version V7.24.9.6

32 Bit Version DFind.exe

64 bit Version DFind64.exe

(Info - No installer, writes only to its own ini file, or a text file if text/print output selected)

Features:


Simple Search

Simple and quick search of one folder, 1 filespec, for one string is set up to be really easy to do.

DFind1

Folders - The Current button selects the current folder, the Browse button allows you to choose a folder
Enter or choose a folder
Enter a Filespec such as *.txt or DF*.pas,  or *.* to search everything
Enter a string to search for in the files
Click the Search button
Look at the results (Shows line numbers and the lines matching in all the files searched)

Note! you can safely search all files in a folder using *.*, DFind will skip any files that it cannot open, binary files, files that take too long to open, files locked because they are in-use, and any files that are not text.

The main benefit of searching a Filespec such as *.pas is to reduce the number of files and time taken for a search.

How fast is DFind?

Here are typical times taken for searches - this is on a typical PC, note I have seen faster times on some networks

DFindTimes

DFindTimes2

DFindTimes3

DFindTimes4

Dfind-Times5

The speed is quite well optimised as:

I have also noticed the 64 bit version of DFind is often faster.


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

Dfind results screen


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 whole screen).

VIewFile-V

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

ViewAsk


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 also 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\EditPlus5\Editplus.exe
XML=E:\Utilities\Programs\Notepad++.exe
PAS=E:\JBData\Programs\EditPlus5\Editplus.exe
BAK=ASK
LST=Viewer
LOG=Viewer

Other Miscellaneous options

OptionsTab1

Most of these are fairly obvious:

Date Options:
This allows to search for files modified only in a date time range.
(e.g. search files in a folder with a huge number of files but only want to search today's files)

View Options:
OPtionsTab3

Use Courier (Non-proportional) font for View Windows (CTRL+V) - this option can work better if you are viewing a text file with columns of data

Search History

Miscellaneous features

Advanced Search using Multiple Folders, Multiple Filespecs, and Multiple Strings

This is the real strength of DFind - you may want to search more than one thing at once!

Advanced Folders - gives option of searching up to 10 different folders

Advanced Filespec - gives option of searching up to 10  different filespecs - e.g. *.pas, *.dfm, *.dpr, *.sql

Advanced Strings - gives option of search for up to 200 strings

Each of these options can be turned on and off individually by clicking the button to the right (grey=Off  green=On)

Advanced search 1

With each of these Advanced options, if turned on you can enter a list.
The selection for these shows when you click in the entry field - e.g. for Folders:

Advanced Folders

For Advanced Filespec:

FilespecScreen

For Advanced Strings:
AdvancedStrings
Any lines with matches to any of these strings will be shown.
Tip:  If for example you are dealing with source files that might have varying formatting or spacing, e.g. some files may have A:=B  and some may have A := B (i.e. with spaces)
Then you can search for both:
A:=B;
A := B;

Note DFind does not yet have a regular search pattern facility (yet), in the meantime multiple strings search is a good alternative.


Search/Replace

Example using Search/Replace

1 - Set up the folder and Filespec to search

2 - Make a file with the old and new strings in it and save it with a name like Test1-DfindSearchReplace.txt

Contents like (the separator between the columns is a TAB character):
(The first part of the line before the tab is the old text to find, and the second part after the tab is the replace text)

minim    crochet
tempo    tempura
error    woopsie
aliquid    asolid
sed    awk
officia    bureaucratic

3  -Load this file into the Selection screen

SearchReplaceOptions

Click the Replace button at the bottom of the page.

Examples of Search/Replace running, with query about replacing a line.
Note at this stage it has loaded the entire file and the display shows all the matches, and it the option to approve
each line is selected it will now go through all the matched lines for the file.
You have the option to approve or not one line change, or yes or not to the remaining lines in the file.

QueryLine

When changes are completed for a file, the screen below is seen - this shows the changed lines for the file.

Save File

Before you decide to save the file or not, it is strongly recommended you use the Show Differences option:
(Note this test example has a very dense number of changes to show you it can handle it)

Show Differences

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

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