Contents

Welcome to Windows Grep 1.3, the powerful text search utility for Microsoft Windows 3.1.

Select the topic you want help on:

Introduction

Toolbar

Status bar

Searching

Configuration

Shareware information


Introduction

Windows Grep is a versatile utility for searching disk files for text strings. In addition to searching pure ASCII files such as program source code files like traditional Grep utilities, Windows Grep can also search any type of binary file, such as word-processor, spreadsheet and database files.

Windows Grep is a MDI application which features a toolbar to speed operation and a status bar. It can be driven using the menu system or the toolbar. It is best used with a mouse. There are two types of windows opened in the MDI frame. Results from a search are output in a result window. Files loaded for viewing are shown in a view window.

To perform a search, the string to find and the file(s) to search must be entered. This is done by selecting File|Search... from the menu, or clicking on the search (magnifying glass) button on the toolbar.

Pressing the OK button in the search criteria dialog box opens a result window and starts the search. If matches are found in text files, lines that contain the specified string will be displayed in the new window. If matches are found in binary files, the match will be shown +/- a user specified number of characters.

During the search, progress statistics are shown. The search can be stopped at any time by clicking on the cancel button, or pressing the space bar. Final statistics will be shown when the search is complete.

Double-clicking on text in a result window causes one of four actions to occur:

- 	The file from which the line clicked on came is loaded into a view window.

- 	The application that originally created the file is run.

- 	An external viewer/editor command is executed.

- 	A dialog is displayed to allow one of the above three choices to be picked.

The action taken can be set by selecting File|Configure... from the menu, or clicking on the configure (spanner) button on the toolbar. It is possible to have different actions set for text and binary files.

Text in either a result window or view window can be output to the printer by selecting File|Print from the menu or clicking on the print (printer) button on the toolbar.

The text can be saved to disk by selecting File|Save As... from the menu or clicking on the save (disk) button on the toolbar.

Windows Grep can be iconised whilst it is searching. The icon caption changes from Windows Grep - Searching to Windows Grep - Finished when the search is complete.

Windows Grep also supports drag-drop from the file manager and has a command line interface. See the relevant sections in this help file for more information.

Related topics:

Toolbar

Searching

Configuration

Command line interface

Drag-drop


Toolbar

The toolbar allows quick mouse access to Windows Grep's main functions.

Click on the button you want help on:


Status Bar

The status bar gives instructions and shows statistics about searches.

The left-hand side gives an explanation of the function of each menu item, and the status of the program during printing and searching.

The right-hand side shows statistics about the active window. If the active window is a result window, the total number of matches in all the files searched is given. If it is a view window, the number of matches in the file being viewed is given.


Searching

Searching is performed by one of four methods:

- Pressing the search button on the toolbar.

- Selecting File|Search... from the menu.

- Dragging files from the File Manager to the main window.

- Supplying parameters on the Windows Grep command line

In the first three methods a dialog is presented which allows search criteria to be specified and options that affect the search to be set.  Clicking OK in the dialog initiates the search.

In the last method, the search criteria is specified on the command line and the search is initiated as soon as the program starts up.

Related topics:

Search criteria dialog box

Drag-drop

Command line interface

Regular expressions


Cunfiguring
Configuring

Many aspects of the operation of Windows Grep can be changed using the configuration dialog, including:

- 	Color and font of text used in the result and view windows

- 	Tab width

- 	Size of binary 'window' shown either side of matches in binary files

-  	Action to take when double-clicking on matches from text and binary files

Configuration changes are saved between sessions.

Related topics:

Configuration dialog box


Shareware Information

Windows Grep is distributed as Shareware. It is not free or public domain. This means you may copy and distribute it freely but should you find it useful and use it beyond an initial evaluation period of 30 days you are both legally and morally obliged to pay the license fee.

The single user license fee is £10.00 or US$20.

Please enquire for site license rates on quantities above 5.

Click here for registration form

Registered users will be sent a registration number to disable the reminder box, and will be informed of any upgrades that may become available.

I would be pleased to receive any comments, bug reports or suggestions for future releases. I may be contacted by E-Mail at the addresses below:

huwmill @ cix.compulink.co.uk

CompuServe: 100016,3452

Related topics:

Acknowledgements

Shareware registration form

Entering your registration information


Grep

Grep is an UNIX acronym for Global Regular Expression Parser


Search

Pressing this button initiates a search. It will be grayed out if a search is already in progress.

Equivalent menu command: File|Search...

Related topics:

Searching


Configure

This button brings up the program configuration dialog. It will be grayed out if a search is in progress.

Equivalent menu command: File|Configure...

Related topics:

Configuration


Save As

Pressing this button allows the text in the active window to be saved to disk. It will be grayed out if no windows are open or a search is in progress.

Equivalent menu command: File|Save As...


Print

Press this button to print the text in the active window to the default printer. It will be grayed out if no windows are open or a search is in progress.

Equivalent menu command: File|Print


Tile

This button will arrange all open windows so they do not overlap. It will be grayed out if no windows are open or a search is in progress.

Equivalent menu command: Window|Tile


Stack

This button will stack all open windows vertically. It will be grayed out if no windows are open or a search is in progress.

Equivalent menu command: Window|Stack


Cascade

This button will arrange all open windows so their title bars are visible. It will be grayed out if no windows are open or a search is in progress.

Equivalent menu command: Window|Cascade


Help

This button activates the help system, although you have probably found that out for yourself by now!

Equivalent menu command: Help|Contents


Result Window

Result windows show results from searches. Matches found are shown in a different colour text. The window title describes the files searched and the string searched for.


View Window

View windows display the contents of text or binary files after a line in a result window has been double-clicked on. All matches in the file are shown in a different colour text. The window title shows the filename and the string that has been matched.


Regular Expressions

Windows Grep supports a wide range of regular expression specifiers.

Click on the one you want help on:

^ 	Circumflex

$ 	Dollar

? 	Question mark

: 	Colon

* 	Asterisk

+ 	Plus

- 	Minus

[ ] 	Square brackets

\ 	Backslash

** 	Double asterisk

Click here for some regular expression examples


Regular Expression Examples

^Windows	matches lines starting with 'Windows'

Grep$	matches lines ending with 'Grep'

H??p	matches 'Help', 'Hoop', 'Harp', etc.

^W?n	matches lines starting with 'Win', 'Won' etc.

\$	matches a dollar sign

fo*	matches f, fo, foo, etc.

fo+	matches fo, foo etc.

[xyz]	matches xx, xyz, etc.

[^xyz]	matches abc but not axb

([0-9])	matches (0), (7), (9) etc.

([0-9]*)	matches (), (0), (123), (2512), etc.

[z-a]	matches nothing

Wi**s	matches 'Windows', 'Winds', 'Wigs', 'Widjkejwkjekwjemekweks' etc.


Registering

To personalise your copy of Windows Grep once you have registered it and received your code:

- 	Select File|Register from the menu to display the registration dialog box.

- 	Enter your name and number EXACTLY as you receive them

- 	Press OK.

The shareware reminder box will no longer be displayed and you may continue to use Windows Grep after the 30 day trial period.

Related topics:

Shareware information

Shareware registration form


Command Line Interface

Windows Grep supports command line parameters to allow it to be used from one of the many Windows command line interface programs.

The syntax is as follows:

WGREP [<options>] <string> <filespec>

<options> are optional and must appear on the command line before the other parameters.

The options provided are:

/c	Count lines only	/c-	Don't count lines only

/i	Ignore case	/i-	Don't ignore case

/n	Number lines	/n-	Don't number lines

/v	Invert match	/v-	Don't invert match

/r	Recurse sub directories	/r-	Don't recurse sub directories

If no options are specified the values saved from previous searches are used.

The <string> and <filespec> parameters are mandatory.

If the parameters are all correct then the search will be initiated as soon as the program is started. If any are missing or incorrect, the program starts up normally.

For more information about the parameters and their meanings see Search criteria dialog box

Related topics:

Search criteria dialog box

Drag-drop


Drag-Drop

Windows Grep supports drag-drop from the Windows 3.1 File Manager.

To initiate a search using this method:

- 	Select the file(s) you want to search in File Manager

- 	Drag them to the Windows Grep window or icon

- 	A modified search criteria dialog box is now displayed. Enter the string to search for and any options in this dialog and press OK

- 	The files selected will be searched as normal.

Related topics:

Drag drop criteria dialog box


Acknowledgements

I would like to thank the following people, whose help has been invaluable during the development of Windows Grep:

Chris Roberts for GREP.DLL. The DLL provides the regular expression compiler and parser. Details on how to use it in your own programs can be found in an accompanying text file. Chris can be contacted at 70550,2601 on CompuServe or  22092 San Fernando Court, Cupertino, CA 95014, USA.

Trevor Prinn (tprinn@cix.compulink.co.uk) for the registration unit.

Tom Swan for his excellent book "Turbo Pascal For Windows 3.0 Programming" published by Borland Bantam.


^ Circumflex

A circumflex as the first character of the string constrains matches to start of lines.


$ Dollar

A dollar as the last character of the string constrains matches to end of lines.


? Question mark

A question mark anywhere in the string matches any single character.


: Colon

A colon matches a class of characters described by the character following:

:a	matches any alphabetic, ignoring case

:d	matches  digits

:n	matches alphanumerics, ignoring case

:	(: followed by a space) matches spaces, tabs and other control characters.


* Asterisk

An expression followed by a asterisk matches zero or more occurrences of that expression.


+ Plus

An expression followed by a plus sign matches one or more occurrences of that expression.


- Minus

An expression followed by a minus sign optionally matches that expression.


[ ] Square brackets

A string enclosed in square brackets matches any character in that string, but no others. If the first character of the string is a circumflex the expression matches any character except the characters in the string. A range of characters may be specified by two characters separated by a -.


\ Backslash

A backslash quotes any character. This allows a search for a character that is usually a regular expression specifier.


** Double asterisks

Two asterisks together match any number of any character and is functionally equivalent to the DOS wild card (*)


Thanks!

Thanks again for registering Windows Grep.

Now you have entered your registration number, the Shareware reminder dialog box will no longer be shown. If you want to disable the timed dialog box shown at start-up as well, add the line:

SplashScreen=0

using Notepad to the [Windows Grep] section of WGREP.INI which can be found in your main Windows directory.

If you have any comments or suggestions for future releases, please let me know!

Huw Millington

West Sussex, England

August 1992.


Search Criteria Dialog Box

Click on the area of the dialog you want help on:


Drag-Drop Search Criteria Dialog Box

Click on the area of the dialog you want help on:


String

Enter the string to locate in this edit box. It can be up to 255 characters and may contain regular expression characters. The last 10 strings entered can be recalled by pressing the down arrow button on the right.

Related topics:

Regular expressions


Filespec

Enter the file(s) to search in this edit box. You can enter DOS wild cards (* and ?) to search multiple files, or specify several discreet filenames separated by semicolons. The last 10 file specs entered can be recalled by pressing the down arrow button on the right.

Examples:

*.PAS	Search all Pascal source files

*.C;*.H	Search all C source and header files

MEMO.TXT;TEST.TXT	Search memo.txt and text.txt

WGREP.DOC	Search the file wgrep.doc


Directory

This shows the directory that the search will be started in. All directories under this one can be searched by selecting Recurse Sub directories in the options to the right.


Directory list box

Use this list box to navigate the directory tree to change the starting directory for the search.


Options

The check boxes below allow options to be set that alter the scope of the search and the format of the search results.


Recurse sub directories

Tick this to have the search include files in sub directories below the one shown above. (default: on)


Count matches only

Tick this to output filenames and a count of matches only. (default: off)


Invert match

Tick this to invert the search and show/count all lines that do NOT contain the search string. Note that this option has no meaning when binary files are searched. (default: off)


Number lines

Tick this option to have matches preceded with their line number in text files and offset in binary files. This option must be on for view window positioning to work. (default: on)


Ignore case

Tick this to cause string comparisons to ignore the case of the search string. (default: on)


OK

Press this button to accept the search criteria and commence the search.


Cancel

Press this button to cancel the dialog and return.


Help

Pressing this button gives quick access to this help screen.


Shareware Registration Form
Registration Form

Print this form and send it with your remittance to:

Huw Millington

71 Woodbury Avenue

East Grinstead

W. Sussex

RH19 3NY

ENGLAND

Please give an e-Mail address if you have one so I can inform you of your registration code as soon as I receive your order, and give timely information on upgrades.

_________________________________________________________

Windows Grep Registration Form.

I wish to register ____ copies of Windows Grep.

I enclose a check/P.O./money order for £______ / $______

(£10 / US$20 per copy)

Name(s)	_______________________________________________

(continue on separate sheet if necessary)

Company	_______________________________________________

Address	_______________________________________________

_______________________________________________

_______________________________________________

Code	___________________

Country	___________________

E-Mail	___________________

I am currently using version _________ of Windows Grep.

I obtained Windows Grep from:

__________________________________________________________

I have the following comments:

__________________________________________________________

__________________________________________________________

Thank you!


Configuration Dialog Box

Click on the area of the dialog you want help on:


Internal options

This panel provides control over the appearance and behaviour of result and view windows.


Re-use internal view windows

This controls the behaviour of view windows.

Un-checked: Every time a line in a file is double-clicked on in a result window the file is loaded into a new view window.

Checked: If the line double-clicked on comes from a file already loaded into a view window, the text in the existing window is repositioned at the new line.


Tab width

Enter the number of spaces to expand tabs in result and view windows.


Binary window

This allows the number of characters shown either side of matches in binary files to be adjusted in the range 0-99.


Text viewer options

The choice in this panel determines what action is taken when a line from a text file in a result window is double-clicked on.


Use internal viewer

Selecting this option causes the file containing the line double-clicked on to be loaded into a view window.


Launch associated application

Selecting this causes the application which originally created the file double-clicked on to be started up with the file loaded.

Note that associations are set up by File Manager and stored in WIN.INI.


Execute command below

Selecting this causes the command in the edit box below to be executed when a line is double-clicked on.


Ask after double-click

When this is selected, a dialog box will be presented after double-clicking to allow one of the above three choices to be picked.


Text viewer command

Enter the command to be run when Execute command below is selected.

The format of the command is as follows:

program-name   parameters

The parameters take the form of tokens that are given values after double-clicking. The following are available:

$f	Name of the file containing the line double-clicked on

$l	Number of the line double-clicked on

$g	The Grep string used for the search

$$	a $

Examples:

notepad.exe $f	Run Notepad passing the name of the file containing the line double-clicked on

myedit.exe $f $l	Run MyEdit.exe passing filename and line number


Colors

The color panel allows the colors used in the result and view windows to be changed


Color list

Select the text color attribute you want to edit in this combo-box, then press the Edit... button. The three attributes are:

Normal text	All non-matching text

Headers	Filenames, line numbers of matching lines, offsets in binary view windows

Highlight	Matches in result windows and text view windows


Color edit

Pressing this will bring up the standard Windows 3.1 color selection dialog to allow the color of the text attribute picked in the combo-box to the left to be changed.


Fonts

The font panel allows the font used in result and view windows to be changed.


Change font

Pressing this button will bring up the standard Windows 3.1 font selection dialog to allow the font used in result and view windows to be changed.


Binary viewer options

The choice in this panel determines what action is taken when a line from a binary file in a result window is double-clicked on.


Binary viewer command

Enter the command to be run when Execute command below is selected.

The format of the command is as follows:

program-name   parameters

The parameters take the form of tokens that are given values after double-clicking. The following are available:

$f	Name of the file containing the line double-clicked on

$l	Offset of the match double-clicked on from beginning of file in decimal

$o	Offset of the match double-clicked on from beginning of file in hexadecimal

$g	The Grep string used for the search

$$	a $

Examples:

write.exe $f	Run Write passing the name of the file containing the line double-clicked on

windump.exe $f $l	Run WinDump.exe passing filename and offset in decimal


OK

Pressing this button saves and activates the changes made.


Cancel

Pressing this button discards changes made and returns to previous settings.


Help

Pressing this button gives quick access this help screen.