QTGrep




QTGrep

A combination of the GNU grep, egrep and fgrep functionalities with the expanded capability of searching for multiple regular expressions and/or fixed strings and optionally replacing strings found. Several different search algorithms are utilized and the appropriate algorithm is chosen automatically. Search/replace operations may be performed. The following help screen is displayed when the program is executed without any arguments:


QTGrep, Linux Vers 3.00. Regular Expression/Keyword Search/Replace. Nov 24 2005
(C) Copyright 1985 - 2005 Terry D. Boldt. All Rights Reserved.
Usage: qtgrep [-options] expression|exp_filename [-options] [@]files...
 Options: (Options Marked '*' Can Be Toggled On/Off For Each File)
  -A*Context lines after match line    -a*Find All Matches
  -B*Record <-> Buffer Operation       -b*Backward (Reverse) Search
  -C*Cumulative Match/Record Count     -c Count of Matches Only
  -D*Use ANSI.SYS Display Driver       -d Restore Default Options
  -E*Fixed Record Length               -e*Output Embedded Matches
  -F*Force Filename on Output          -f File for Search Patterns
  -G                                   -g
  -H*Filename Output on 1st Match      -h*No Filename Headers
  -I*Output Match Index and Length     -i*Ignore Case
  -J                                   -j*Filename Field to Specified Width
  -K Force Keyword Search              -k*Count of Matchs, Each File
  -L Display License & Quit            -l*Longest <-> Shortest Match
  -M*Output Match String               -m*Stop After nn Matches
  -N*Output Pattern Number             -n*Output Record Numbers
  -O*Context lines Before/After match  -o*Display Filename When Opened
  -P Noprompt, Patterns From Std Input -p Prompt, Patterns from Std Input
  -Q Quiet operation                   -q Query, Output Search Expressions
  -R Force Regular Expression Search   -r Match Replacement (Req. Pat. File)
  -S Recurse Sub-Directories           -s Count of Matchs, All Files
  -T*Output Tagged Strings             -t Output Files Scanned/Files matched
  -U*U**x <-> OS/2 Style Records       -u*Scan File to Uppercase
  -V Verbose Count of Matches Only     -v Output Only Records Not Matching
  -W Write Compiled Search Patterns    -w
  -X*Force U**x stlye Records          -x*U**x, DOS-OS/2 or Apple Records
  -Y*Context lines before match line   -y*Ignore Records (sets B option)
  -Z File  Preview                     -z Simulate Match Replacement
  ------------------------------------------------------------------------
  -?x Info. on Option 'x'              -?% Info. on Configuration File
  -?# Info. on Pattern File Operators  -?@ Info. on Spec. Scan/List Files
  -?~ Info. on R. E. Operators         -?$ Info. on Counting Tagged Strings
  -?= Info. on Spec. Options/Values    -?+ List Predefined Named Expressions
  -?! Usage Comments                   -?- For information on Long Options

The full QTGrep documentation is available in both 'PDF' (size 1.2 MB) and plain ASCII text (size 53.4 KB) is available. The Linux executables qtgrep (forward only searches), qtgrepb(both forward and reverse searches) and prnpat (convert internal format pattern files to C language files) are available (sizes: 276.2 KB). The full source (size: 683.1 KB) is available under the GPL. Sample QTGrep pattern files are available in a tarred/bzipped file (size: 125.7 KB). The file also contains QTAwk utility files. Signature files are available for the executables and the source file.

The companion application prnpat is also available and contained in the executables file. The prnpat application is used in conjunction with QTGrep. Use the 'f' and 'W' options of QTGrep to convert a pattern file into internal binary format. prnpat then reads the internal binary format file and writes the search data structures to a 'C' language data file, usually a "*.h" that is then included with 'C' source. The QTGrep object file 'scan_routines.o' may then be linked with the application program. Uing these object routines in conjunction with the data file written by prnpat, the QTGrep regular expression and keyword search facilities may be incorporated into any program.


© Terry D. Boldt 1997-2005
All Rights Reserved
Last Updated: Dec. 12, 2005