TextAnalysisTool Documentation

David Anson (DavidAns@Microsoft.com)
December 28th, 2001


Overview - The Display - Menu Items - Mouse Actions - Shortcut Keys - Function Descriptions - Regular Expression Syntax - Command-Line Parameters - Registry Settings - FAQ - Tips and Tricks - Planned Features - Known Issues - Bug Reports


Overview

The Problem
For applications that produce a great deal of textual output, finding a particular line of interest can be quite difficult. Standard text editors usually provide some sort of "find" functionality, but that limited capability can be inadequate when it is necessary to compare two or more widely separated lines. Some of the more sophisticated editors help by allowing you to "mark" lines of interest (often by placing a bookmark at that location in the file). Marking lines can be a tremendous help, but is often not enough.

The Solution: TextAnalysisTool
For times when nothing else will do the trick, there's TextAnalysisTool - a program designed from the start to excel at viewing, searching, and navigating text files as quickly and efficiently as possible. TextAnalysisTool provides a view of the text file that you can manipulate (through the use of various filters) to display exactly the information you need.

Filters
Before displaying the lines of a file, TextAnalysisTool runs the lines of that file through a set of user-defined filters, removing or dimming any lines that do not satisfy one of the filters. (In other words, TextAnalysisTool displays the union of the lines accepted by each filter.) Filters can do such things as select only the lines that contain a given sub-string, select only the lines that have been marked with a particular marker type, or select only the lines that match a given regular expression. In addition to the standard "inclusive" filters that isolate lines of text you want to see, there are also "exclusive" filters that can be used to suppress lines you do not want to see. Excluding filters are configured just like normal filters but are processed after all normal filters have already been run. The effect of an excluding filter is to remove all lines that meet its criteria from the collection of filtered lines. Excluding filters allow you to easily reduce the output from an overly active inclusive filter.

Markers
Markers are another way that TextAnalysisTool makes it easy to navigate a file; TextAnalysisTool allows you to mark a line with one or more of nine different marker types. Once lines have been marked, TextAnalysisTool allows you to easily view only marked lines or quickly navigate between similarly marked lines.

Find
TextAnalysisTool also provides a flexible "find" function that allows you to search for text anywhere within a file. This text can be a literal string or a regular expression, so it's easy to locate the specific line you seek.

Ease of Use
TextAnalysisTool was written with overall speed in mind: it saves you time by allowing you to save and load filter sets; text can be input to TextAnalysisTool by opening a file, dragging-and-dropping a file onto the TextAnalysisTool window, or by pasting text from the clipboard; you can even share the results of your filters by copying lines to the clipboard or by saving the current set of lines to a file.


The Display

The TextAnalysisTool display is divided into two different sections:

Text Display
The text display portion of the TextAnalysisTool window displays the lines with which you are currently working. Along with the line's original line number, TextAnalysisTool will indicate which markings have been applied to that line as well as whether or not the line meets any of the current filter criteria (by dimming undesired lines). The text display highlights the current line (the line to which any changes (e.g., markings) will be made) and allows you to navigate using the standard directional controls (arrows, Page Up, scroll-bars, etc.). The primary mouse button allows you to quickly change the current line, while the secondary mouse button gives you access to a menu with line-specific functionality (such as setting markers).

Filter Display
The filter display portion of the TextAnalysisTool window displays the filters with which you are currently working. Filters can be enabled or disabled simply by clicking on them with the primary mouse button; when disabled, filters are dimmed. Further functionality is available with the secondary mouse button which gives you access to a menu with filter-specific functionality (such as editing, moving, or removing a filter).

Splitter Bar
The splitter bar allows you to resize the text and filter displays within the TextAnalysisTool window. Changes are remembered the next time you start TextAnalysisTool.


Menu Items
Menu    Item    Function
File
Open... Open and display a text file (Details)
Refresh Refresh the view of the file (Details)
Save Current Lines... Save the currently displayed lines to a text file (Details)
Open Configuration... Open a configuration file and apply its settings (Details)
Save Configuration... Save the current configuration to a configuration file (Details)
Exit Exit the application
Edit
Copy Copy the currently displayed lines to the clipboard (Details)
Copy Current Line Copy the current line to the clipboard (Details)
Paste Paste text from clipboard into the display (Details)
Find... Find the next occurrence of a string (Details)
Find Next Repeat the last find operation (searching forward)
Find Previous Repeat the last find operation (searching backward)
Go To... Set the current line to a specific line number (Details)
View
Show Only Filtered Lines Toggle showing/hiding of lines that do not meet the filter criteria (Details)
Filter
Add Filter... Add a filter (Details)
Disable All Filters Disable all filters in the filter list (Details)
Remove All Filters Remove all filters from the filter list (Details)
Help
Documentation Displays a copy of the TextAnalysisTool documentation in a new window
About Display information about the application


Mouse Actions

Text Display
Action    Function
Click primary button Sets the current line to the clicked-on line
Click secondary button Opens a context menu that lets you enable or disable markers for the clicked-on line
Rotate mouse wheel Scrolls the text display according to the current system settings
 
Filter Display
Action    Function
Click primary button Enables/disables the clicked-on filter
Click secondary button Opens a context menu that lets you enable, disable, reorder, edit, or remove the clicked-on filter
Rotate mouse wheel Scrolls the filter display according to the current system settings
 
Splitter Bar
Action    Function
Click-and-drag primary button Resizes the text and filter displays


Shortcut Keys
Key    Function
Ctrl+A Add a filter (Details)
Ctrl+C Copy the currently displayed lines to the clipboard (Details)
Ctrl+F Find the next occurrence of a string (Details)
Shift+Ctrl+F Find the next occurrence of a string searching backward (Details)
Ctrl+G Set the current line to a specific line number (Details)
Ctrl+H Toggle showing/hiding of lines that do not meet the filter criteria (Details)
Ctrl+L Copy the current line to the clipboard (Details)
Ctrl+O Open and display a text file (Details)
Ctrl+S Save the currently displayed lines to a text file (Details)
Ctrl+V Paste text from clipboard into the display (Details)
Space Set the current line to the next line that meets the filter criteria
Shift+Space Set the current line to the previous line that meets the filter criteria
1, 2, ..., 9 Set the current line to the next line marked by marker type n (ignores the current filter criteria)
Shift+1, 2, ..., 9 Set the current line to the previous line marked by marker type n (ignores the current filter criteria)
Ctrl+1, 2, ..., 9 Toggle marker type n for the current line
F3 Repeats the last find operation (searching forward)
F2 or Shift+F3 Repeats the last find operation (searching backward)
F5 Refresh the view of the file (Details)
Up/Down Arrow Move the current line up/down
Ctrl+Up/Down Arrow Scroll up/down without changing the current line
Left/Right Arrow Scroll left/right one character
Home/End Scroll to the extreme left/right of the display
Ctrl+Home/End Move the current line to the extreme top/bottom of the display
Page Up/Down Scroll up/down a page without changing the current line


Function Descriptions

Open and display a text file
Discards the current set of lines and displays the lines of the specified text file after running the currently enabled filters on the entire file.

Refresh the view of the file
Reloads the current file. This command makes it easy to re-analyze files that have changed since being opened.

Save the currently displayed lines to a text file
Saves the currently displayed lines to a file, including information about line number and whether or not each line meets the filter criteria. Note that any lines that are not being displayed (because they do not meet the filter criteria and you've chosen not to display such lines) will not be saved to the file.

Open a configuration file and apply its settings
Opens a TextAnalysisTool configuration file, replacing any existing filters with the filters stored in the configuration file and running any new filters that are enabled.

Save the current configuration to a configuration file
Saves a TextAnalysisTool configuration file, storing the state of all current filters.

Copy the currently displayed lines to the clipboard
Copies the currently displayed lines to the clipboard, using the same format as when saving the current lines to a file. (Details on the format)

Copy the current line to the clipboard
Copies the text of the current line to the clipboard. Note that information about markers and filter acceptance is not placed on the clipboard.

Paste text from clipboard into the display
Discards the current set of lines and displays the text on the clipboard after running the currently enabled filters on that text.

Find the next occurrence of a string
Finds the next occurrence of the specified text string, allowing you to optionally ignore case and/or match against a regular expression and/or search backwards.

Set the current line to a specific line number
Sets the current line to the specified line number, scrolling the display (if necessary) to bring the line into view.

Toggle showing/hiding of lines that do not meet the filter criteria
Selects whether or not lines that do not meet the current filter criteria are displayed along with lines that do meet the criteria. This toggle is useful to either remove unrelated lines from view or to show the context of a line that meets the filter criteria. Note that the current line is unchanged whenever possible; otherwise it is kept near its previous location.

Add a filter
Adds a new filter to the list of current filters and automatically enables the new filter. This command brings up a dialog box that allows you to choose the type of the new filter and then an additional dialog box that allows you to configure the specific filter type.

Disable all filters in the filter list
Disables all filters (but does not change anything else).

Remove all filters from the filter list
Removes all filters, emptying the filter list.


Regular Expression Syntax
TextAnalysisTool's "Matches Regular Expression" filter uses Eric Niebler's RegExpr C++ classes to parse and handle regular expressions. RegExpr supports the full Perl 5 syntax for regular expressions, so TextAnalysisTool's filter does as well. Documentation for Perl 5 regular expression syntax is not available here, but is widely available via books and the Internet. One particularly good web-site is the Perl Regular Expressions page on http://www.perl.com/. An excellent book reference is Programming Perl, 3rd Edition by O'Reilly & Associates, Inc. (also known as "The Camel Book").


Command-Line Parameters
TextAnalysisTool [TextFile] [/ConfigurationFile:ConfigFile]
   TextFile - Name of the text file to open
   ConfigFile - Name of the configuration file to open

Example:
TextAnalysisTool \Logs\MyLog.log /ConfigurationFile:"\Configs\MyConfig.tat"


Registry Settings
Value    Type    Default    Function
GoToPositionPercent DWORD 50 (0x2d) The percent of the way down the text display at which the current line should be positioned after a being set via a "Go To" command
SplitterHeight DWORD 7 (0x7) The height (in pixels) of the splitter bar
TabWidth DWORD 4 (0x4) The number of spaces corresponding to each Tab character
TextFontPointSize DWORD 10 (0xa) The height of the font (in points) used to display text
WindowSplitPercent DWORD 75 (0x4b) The percent of the TextAnalysisTool window used to display text (with the remaining portion of the window being used to display filters)
WindowPositionState DWORD × Used to save and restore TextAnalysisTool's window position
WindowPositionLeft DWORD × Used to save and restore TextAnalysisTool's window position
WindowPositionTop DWORD × Used to save and restore TextAnalysisTool's window position
WindowPositionRight DWORD × Used to save and restore TextAnalysisTool's window position
WindowPositionBottom DWORD × Used to save and restore TextAnalysisTool's window position

All TextAnalysisTool registry settings are stored under the key HKEY_CURRENT_USER\Software\DavidAns\TextAnalysisTool


FAQ


Tips and Tricks


Planned Features
None


Known Issues
None


Bug Reports
Please send email to me, David Anson (DavidAns@Microsoft.com), with a detailed description of any problems you encounter. Whenever possible, please include a file that demonstrates the problem.


Thanks and enjoy!!!