gbSearch is a freeware utility for finding files which meet user-specified criteria. It provides over 125 different settings or actions which a user may employ to tailor a search, review the search results, and act on the matching files.
Searches may specify wild card file name patterns and may be constrained to one or more specified file extensions. Searches can also be constrained to return only files which contain specified search terms, or which meet specified date/size criteria.
A search may be limited to a single folder or may include subfolders.
While searches can find any type of file, special support is provided for text files, including an integrated text file viewer. Within the viewer, search terms can be highlighted. Or, the display can be limited to only lines which contain the search terms.
A significant feature of gbSearch is the ability to create a merge file - a text file containing the content of all files meeting the specified criteria. Merge files offer several unique advantages which make reviewing search results especially easy.
To install, simply unzip the installation file (gbsearch.zip) in a folder of your choice. In addition to the EXE, the installation includes gbSearch source code, the resource file, and image files.
Download (v1.0, 400K) |
Then just press the search button on the toolbar to see a list of files which match the criteria. Click on a file in the results list to view it in the integrated text file viewer, or double click on a file to open it with the local default client for that file type.
That's it!
In unrestricted mode, the user can still apply a similar constraint, but must do so by typing in the extension information to the file name filter. In unrestricted mode, the toolbar is somewhat narrower, which is preferred by some users.
UnRestricted Mode
While gbSearch features emphasize text files, searches can be made on any file type. In the
"unrestricted" search mode, the gbSearch interface is simplified to this:
In unrestricted mode, the user can search for any file extension by entering the extension type in the Name Filter. This is discussed in more detail further down this page.
Restricted Mode
Whereas in "restricted" mode, gbSearch additionally displays the toolbar buttons which allow
the user to specify text file extensions to include in the search. In this mode, only files
which have the selected extensions will be returned from a search.
Optional GUI Elements
Regardless of whether the extension-specific toolbar buttons are displayed, the gbSearch
interface may include two optional elements - a folder browser (left side) and a
text file viewer (along the bottom). Both are shown in this image:
Unrestricted Mode
In unrestricted search mode, the toolbar looks like this. It does not have the extension-specific
buttons. Click the image to see a full-size version.
Restricted mode
Then, in restricted search mode (constrained to specified extension list), it looks like
this. It includes the extension-specific buttons. Click the image to see a full-size version.
Extension-Specific Toolbar Buttons
Here's an image of the extension-specific buttons. An explanation of each is provided in
the discussion below.
Toolbar Button Descriptions
This button provides a dropdown menu which will show a list of the drive
letters currently available on the user's PC.
This button provides a dropdown menu which will show a list of the drive
letters currently available on the user's PC.
In addition to a menu item that opens the extension list for
editing (opens the file "extensions.txt" in Notepad), the dropdown
menu also lists all extensions found in the extensions list.
gbSearch does not provide Undo support for changes typed by the user within the
File Viewer. At any time, however, the user can reload the currently displayed
file by simply clicking on the filename in the ListView control.
Within the File Viewer context menu are almost 40 different commands
which can modify the text within the File Viewer. Before each of these commands is executed, the
content of the File Viewer is saved and may be restored using the toolbar Undo
button. Once content is restored, the toolbar Undo button is grayed out to indicate
that the content has been restored and that an Undo operation is no longer available.
The search terms will be applied only to text files, where text files are
defined files with .bas/.inc/.txt extensions and files whose extensions are found
in the extensions list (extensions.txt).
The file viewer will display only files which gbSearch recognizes as text files.
When unrestricted searches are enabled, these toolbar buttons are removed from the
toolbar:
The dropdown button provides the following context menu options.
Search terms are entered into the Search Term(s) combobox, separated by a space.
The use of double quotes to define a multi-word search term is not supported by gbSearch.
An additional toolbar button, "Match Case", can be used with search terms to provide
case-sensitive searches.
Once a search term is used in a search, it is added to the search term dropdown list
and may be selected for subsequent searches.
Unrestricted Search
In unrestricted search, the Name Filter can also be used to define multiple patterns,
as these examples demonstrate.
Restricted Search
In the following examples, the file name patterns describe only the name, not the
extension.
In a restricted search, gbSearch appends the Name Filter (up to the first . found in the
string) to the selected extensions (.bas/.inc/.txt and extensions list) to create the
complete search pattern used in the search.
The results may be sorted on any of the columns of data by clicking
on the column header.
Each line in the list contains a checkbox, which is checked by default.
Various features in gbSearch act on only those files which are checked.
Over 25 actions may be taken on items within the results list. See the
Context Menus section below for more details.
To view a file in the user's default text editor, double-click on a file
in the search results list. A file may also be opened from the results
list context menu.
To open a file in a specified text editor, select that option from the results list
context menu. The context menu also provides an option to select the specified
text editor.
Internal Viewer/Editor
When the cursor is located in the File Viewer, the line number is placed in the
left partition of the statusbar.
A splitter bar is located between the search results list (ListView control) and the
built-in text file viewer (RichEdit control). Use the mouse to adjust the vertical size of
the built-in text file viewer.
Navigation In File Viewer
To make it easier to view matching content, all lines which do not match the search
criteria may be removed from the file viewer (keep matching lines).
Also, when a merge file is displayed in the File Viewer, menu options allow the
user to move from one file (divider) to the next/previous one. Also from a merge file,
a user can open whichever file the line at the cursor is from.
Navigation Symbols
Identify Duplicates of Selected File
Visually Compare Two Files
Text to remove is in red/strikeout. Text to be added is in blue. Text
common to both files is in black.
The divider is optional. Also, the user can select which symbols are placed at the
start of each divider line.
The concatenated text is saved to a file called mergefile.txt, located where the gbSearch
EXE is installed. Once created, the merge file is displayed in the File Viewer, but the
mergefile.txt file is not added to the results list.
A setting is available to open the merge file automatically, in the users .txt client application.
Merge File Features
These features are discussed in more detail in the Context Menu section below.
gbSnippets Library File
The new file is always call "gbsearch.gbs and is placed in the same folder where gbSearch
is installed. The library file is automatically opened when created.
ComboBox Context Menus
Each of the context menu items are discussed below.
Search List Context Menu
Note that not all clients accept multiple file names as command line inputs, so use of this
option will depend on the capability of the users default client application.
Note that not all applications accept multiple file names as command line inputs, so use of this
option will depend on the capability of the specified application.
Viewer Context Menu
Base Folder ComboBox
Name Filter ComboBox
Search Term ComboBox
INI File
Console
While primarily a programmer's debug tool, users may find it interesting to see
a list of the folders searched and of the procedures used when features are executed.
Comments and suggestions are welcome!
Each of the toolbar buttons are described here.
Folder
Opens a dialog from which to select the base folder.
This is an alternative to displaying the folder browser that was
discussed above.
The dropdown menu associated with this button is discussed below.
Search
Search for matching files. Using other toolbar buttons,
the search may be constrained to files with selected extensions, those that
fall within specific date/size ranges, or those that contain the
search terms.
Merge
Creates a text file containing the content of all selected files.
The file is named mergefile.txt, is stored in the gbSearch folder,
and is automatically displayed in the file browser (if it is visible).
Undo
Restores the text editor to the last saved state.
See the discussion further down this page for more information about
the limited Undo capabilities of gbSearch.
Explorer
Toggles display of the integrated folder browser (Explorer)File Viewer.
Viewer
Toggles display of the integrated File Viewer. To view a file
in the viewer, just click on the file name in the results list.
All
Includes files .bas/.inc/.txt extensions, as well as any extension
found in the extension list, in searches. This does not mean that
all extensions (such as EXE, DLL, ...) are included. To expand the search in
that fashion, set the search mode to UnRestricted via the dropdown menu attached
to the toolbar Settings button.
.bas
Includes files with .bas extensions in searches.
.inc
Includes files with .inc extensions in searches.
.txt
Includes files with .txt extensions in the search.
List
Includes files with any extensions found in the
extension list (extensions.txt) in searches. A default list of
extensions is provided. The list may be edited by the user via
the button's dropdown menu.
Date
Constrains searches to look for files within the date range.
This button's dropdown menu allows the user to set the From: and To: dates,
as well as to reset both date to the current date.
Size
Constrains searches to look for files within the size range.
The size range may be changed using the button's dropdown menu.
This button's dropdown menu allows the user to set the Min: and Max:
file sizes.
Terms
Constrains searches to look for files containing the search terms.
The button's dropdown menu can be used to adjust how search terms are used.
The option are All (the file must contain all of the search terms), Any (the
file must contain at least 1 of the search terms) or Complete String
(the file must contain the exact sequence of search terms).
Subfolders
Enables searches to include subfolders of base folder
Exact Match
Forces case-sensitive searches when using search terms
Settings
Toggles display of text on the toolbar buttons.
The next section discusses the settings available through this button's
dropdown menu.
Online Help
Opens the gbSearch online Help page
Settings
The toolbar Settings button dropdown menu displays the following menu options:
Display Toolbar Text
Toggles the display of text under the toolbar icons
Exact File Size
Allows display of file size in the results list as bytes or kilobytes
Colored Lines
Displays alternating background line colors in the results list. This makes
it easier for the users eyes to track a line as their eyes move across the page.
Select Line Color
Opens a color selection dialog for the color lines.
AutoSize to Dialog Width
Causes the columns of the results list to automatically adjust to the width of the main dialog.
AutoSize to Data
Causes the columns of the results list to automatically adjust to the width of the data in each column.
AutoSize to Disabled
Disables automatic adjustment of the results list columns.
Line Numbers
Adds lines numbers to the File Viewer. In the case of merged files with dividers,
the file numbers start over for each file (at each divider).
Dividers
Enables the use of dividers when a merge file is created
AutoOpen
Automatically opens a merge file when it is created. The users default *.txt client is used.
Include Hidden/System Files
By default, Searches include normal files and folders. This option enables the search to detect both hidden and system files.
Allow File Deletion
As protection to the user, actions which delete files are inactive by default.
This setting must be selected to enable the file deletion actions.
Unrestricted Search
Unrestricted search mode allows the search to detect all file extensions. A restricted search mode
restricts the search to .bas/.inc/.txt file extensions, as well as those extensions found in the
extensions list (extensions.txt).
Undo
The focus of gbSearch is on finding and viewing files which match the
search criteria. However, the File Viewer does allow the user to edit
the file content and then save the changes under the selected file name,
or to a new file.
Selecting a Starting Folder
gbSearch provide five ways to select the base folder.
The user may simply type in the base folder. gbSearch will alert the users if
the entered folder does not exist.
The toolbar Folder button displays a dialog from which the base folder (where the search starts)
may be selected.
With the integrated Folder Explorer displayed, double-click on a folder to use it as the
base folder.
Each time the "Base Folder" label is double-clicked, the base folder is moved up one
level from the current base folder setting.
Whenever a search is made, the current base folder is added to a list of previous
search folders, and is then available from the dropdown list associated with the
folders combobox.
Unrestricted File Search
When an unrestricted file search is enabled, all files extensions may be
retrieved in a search. However, some constraints apply.
Search Terms
Search terms may be used to select which files are returned by a search. The
options which controls how the search terms are available by pressing the
dropdown button next to the Terms toolbar button.
Only files which contain all of the search terms will be returned by a search
Only files which contain at least one of the search terms will be returned by a search
The entire string, as entered into the Search Term(s) combobox,
is treated as a single search term. Spaces are included as part of the search string.
(File) Name Filter
The Name Filter in gbSearch is used differently, depending on whether a restricted or
unrestricted search is made.
In an unrestricted search, the Name Filter is used to define both the file name and
the file extension. These examples should be familiar to most user:
*.*
*.bmp
*.d*
file??.txt
*.txt;*.bak
*.bmp;*.gif;*.ico/*.jpg
gary*.doc;bob*.xls;henry*.ppt
In a restricted search, the extension is set by pressing the appropriate toolbar
extension buttons - .bas, .inc, .txt or the extension List. So in a restricted
search , the Name Filter is used to describe only the file name - not
the extension.
*
*tool*
gb??
Search Results List
The result of a search is a list of files meeting the search criteria (file
extension, file name pattern, exact match, subfolders, search terms, date and size).
The file name, file path, last date modified, file size, and extension are listed.
Viewing Text Files
Files in the search results list may be viewed in three different ways - with the
internal viewer/editor, with the default text editor on the user's PC, and with a
specified client text editor.
Press the toolbar text file viewer button to display the built-in file viewer, which
will be located at the bottom of the gbSearch main window. When the file viewer is
displayed, clicking on a file in the search results list will display the file.
When a file is displayed in the built-in file viewer, a user may highlight search terms
and then move to the first/next/previous occurrences of the search terms.
In the left margin next to the file viewer are 4 symbols. Clicking on these symbols provides
shortcuts to items from the file viewer context menu.
File Comparisons
Two types of file comparisons are supported.
gbSearch can identify (check) all files in the search results list which match a
selected file. Just right mouse click on a file in the list and select the
"Check Duplicates of Selected File". All non-duplicate files will be unselected.
A visual comparison of two files is available. Simply select two files from the
search results list and select the "Visually Compare Checked Files (2)" context menu option.
This will automatically open the built-in file viewer and display content which
shows the changes required to change the first marked file to the second marked
file.
Merge Files
A merge file is simply a concatenation of all the checked files currently in the results
list, separated by an optional divider line. It looks like this:
==++== c:\temp\test\file1.bas
... content of file1.bas
==++== c:\temp\test\file2.bas
... content of file2.bas
==++== c:\temp\test\file3.bas
... content of file3.bas
Presenting the content of multiple files as a single listing makes it easier to browse through
the results list. But gbSearch provides additional features which enhance the utility of merge files.
A special merge file option is also available - that of combining multiple files,
formatted as a gbSnippets library file. This allows you to create source code libraries
which can then be loaded into gbSnippets, with full access to the editing and execution
capabilities it provides.
Context Menus
gbSearch does not have a main menu, as is often used by apps. Instead, the
toolbar and control context menus provide the user with all available features.
The base folder, file filter, and search term(s) are displayed in combobox
controls. Each of these has a context menu:
Base Folder
Name Filter
Search Term(s)
Search List Context Menu
Viewer Context Menu
Display a brief summary of results list (file count, number files selected)
Clear the results list (and the file viewer also)
Check all files in the results list
Remove the check from all files in the results list
Reverse the check for all files in the results list
Remove the selected file from the results list. Only one file may be selected at any time. The
file is removed from the results list. It is not deleted from the hard drive.
Remove the checked files from the results list. The files are only removed from the list.
The files are not deleted from the hard drive.
Remove the unchecked files from the results list. The files are only removed from the list.
The files are not deleted from the hard drive.
Remove the selected file from the results list and from the hard drive.
Remove the checked files from the results list and from the hard drive.
Use the path of the currently selected file as the base folder. The path is placed in
the Base Folder combobox.
Open a window to the path of the selected file
Copy a list of all checked file to the clipboard. Only the full path of the checked files are
included in the list (data from the name/date/size/ext are not included in the list).
Create a subfolder called "working", and copy all checked files to that folder. The original
files are left alone. This provides a work space for the user to collect or modify the files
for any purpose they chose.
Open a window to the working folder path
Remove all files from the working folder. The folder itself is not deleted. If the user manually creates a subfolder within the working folder, files within that folder are not delete.
Each file in the results list is compared to the selected file. All matching files are checked. All
non-matching files are unchecked.
Display (in the file viewer) a visual comparison of two files (the first two selected files in the results list.
The display shows the changes required to change the first marked file to the second marked file.
Text to remove is in red/strikeout. Text to be added is in blue. Text common to both files is in black
Opens the selected file in the users default client application
Attempts to open all checked files in the users default client application. It does so by providing
a list of all selected files as a command line input to the client application.
Opens the selected file in the specified client application
Attempts to open all checked files in the specified application. It does so by providing
a list of all selected files as a command line input to the specified application.
Opens a file browser dialog from which to select an application that will be used where the
"specified client" is to be used
Exports the results list to the file gbsearch.csv using a comma-delimited format. Data in
each column of the results list are enclosed in double quotes and separated by commas.
Exports the results list to the file gbsearch.txt. Data in each column is separated by
a default divider string of " ++ ".
Exports the results list (Full Path column only) to the file gbsearch.txt.
Display a brief summary of the content of viewer (lines/characters)
Copy selected text to clipboard, then delete the selected text
Copy selected text to clipboard
Insert clipboard text content at the cursor
Remove the selected text
Copy the entire content of the viewer to the clipboard
Locate the first occurrence, from the start of the document, of any search term
Locate the next occurrence, from the cursor position, of any search term
Locate the previous occurrence, from the cursor position, of any search term
Locate the next divider line, from the cursor position
Locate the previous divider, from the cursor position
Move to the previous divider line and open the file name found on that line
Highlight all words in the viewer content which match any of the search terms
Remove highlighting from all words
Highlight all words in the viewer content which match any of the search terms,
then remove all lines which do not contain a matching word
Sort the entire content of the viewer in ascending order
Sort the entire content of the viewer in descending order
Save the current file viewer content, as edited by the user, as the selected file name
Save the current file viewer content, as edited by the user, to a file. A dialog is presented
to allow the user to select the folder and file name to be used.
Display the contents of the mergefile.txt file in the file viewer. That file will contain the
contents as created by the last use of the "Create Merge File" command.
OPen the mergefile.txt file in the users default text file client application
Add line numbers to all lines (excluding merge file divider lines). The format used is 9 characters
wide, a 6 digit number followed by 3 spaces. For example, "0000001 ".
Delete the first 9 characters of all lines (excluding merge file divider lines)
Remove all lines which start with the divider symbols, "==++==" by default, followed by 3 spaces
Remove all blank lines. A line with only spaces is considered a blank line.
Replace all strings of more than 1 space with a single space
Convert entire content (not just the current selection) of file viewer to upper case
Convert entire content (not just the current selection) of file viewer to lower case
Remove leading/trailing spaces from all lines
Remove leading spaces from all lines
Remove trailing spaces from all lines
Insert a single leading space on all lines
Delete the first character from all lines
Insert 4 leading spaces on all lines
Delete the last 4 characters from all lines
Sort the entire content of the viewer, then remove all duplicate lines.
Split the entire content of the viewer into a list of words, using the space
character to define word separation. Create a sorted list of the results and
remove all duplicate words.
Copy selected text to clipboard, then delete the selected text
Copy selected text to clipboard
Insert clipboard text content at the cursor
Empty the base folder history list
Copy selected text to clipboard, then delete the selected text
Copy selected text to clipboard
Insert clipboard text content at the cursor
Empty the name filter history list, then add the single entry "*"
Copy selected text to clipboard, then delete the selected text
Copy selected text to clipboard
Insert clipboard text content at the cursor
Empty the search term history list
Other Comments
This sections contains miscellaneous additional information about using gbSearch.
gbSearch saves all of it's options in an INI file, which is placed in the same folder
as the EXE.
A DOS console may optionally be displayed, in which gbSearch will print the
names of the internal functions, as they are executed. Additionally, for
searches which use the search subfolders option, the list of folders searched
will also be listed in the console.