gbSearch

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.

Key Features

gbSearch provides a wide range of features, all focused on making it easier to find and manipulate information in text files.


Using gbSearch

Using gbSearch couldn't be simpler. From the toolbar, select the optional search criteria by pressing the appropriate toolbar buttons:
  1. file extensions to include in the search
  2. files within a date range
  3. files within a size range
  4. files containing search terms

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!


User Interface

gbSearch allows the toolbar to be modified to reflect one of two search modes - restricted and unrestricted. In restricted mode, the toolbar provides several buttons which allows the user to easily constrain searches to a specified list of file extensions. The convenience comes at the cost of a wider toolbar.

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:



Toolbar

gbSearch's search commands are found in its toolbar (no menu is used). So going through it first will cover the main features of gbSearch.

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
Each of the toolbar buttons are described here.


Settings

The toolbar Settings button dropdown menu displays the following menu options:


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.

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.


Selecting a Starting Folder

gbSearch provide five ways to select the base folder.


Unrestricted File Search

When an unrestricted file search is enabled, all files extensions may be retrieved in a search. However, some constraints apply.

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:

       


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.

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.


(File) Name Filter

The Name Filter in gbSearch is used differently, depending on whether a restricted or unrestricted search is made.

Unrestricted Search
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

In unrestricted search, the Name Filter can also be used to define multiple patterns, as these examples demonstrate.

     *.txt;*.bak
     *.bmp;*.gif;*.ico/*.jpg
     gary*.doc;bob*.xls;henry*.ppt

Restricted Search
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.

In the following examples, the file name patterns describe only the name, not the extension.

     *
     *tool*
     gb??

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.


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.

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.


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.

Internal Viewer/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 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
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.

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
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.

Identify Duplicates of Selected File
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.

Visually Compare Two Files
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.

Text to remove is in red/strikeout. Text to be added is in blue. Text common to both files is in black.


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

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
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.

These features are discussed in more detail in the Context Menu section below.

gbSnippets Library File
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.

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.


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.

ComboBox Context Menus
The base folder, file filter, and search term(s) are displayed in combobox controls. Each of these has a context menu:

Each of the context menu items are discussed below.

Search List Context Menu

Viewer Context Menu

Base Folder ComboBox

Name Filter ComboBox

Search Term ComboBox

Other Comments

This sections contains miscellaneous additional information about using gbSearch.

INI File
gbSearch saves all of it's options in an INI file, which is placed in the same folder as the EXE.

Console
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.

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!