Age of Reason

Random musing of books and stuff I am reading.

2005/07/13

Mgrep Find-Grep-Filter-Edit in QT

Here is a QT program mgrep with source to
find-grep-filter-edit for files on your disk.

Why is it better than 'gnu find and gnu grep'?
It keeps history of all options and grep/find out text across sessions.
The earlier version used external process to launch gnu grep and gnu find,
then I decided to use QRegExp and simplify the source.
Feel free to improve on it, I will move it to source forge later.

Here is the source mgrep.cpp mgrep.h and download the whole mgrep.zipt
The zip file contains the vc6 project (dsp,dsw,cpp,h,exe) for windows.
Linux users can use the GPL version of the QT to compile it.

To compile on windows, you will need QT library, which
comes with Blanchette's QT book. You can get this book with QT CD
from Nerdbooks.com. If just want to run the mgrep.exe on windows,
you will need QT-MTNC321.DLL for windows, download it from here.
The CD on the book comes with Borland C++ bcc 5.5; or
you can use VC++6 with sp6.

> tail mgrep.txt

PROS and CONS to Mgrep

Mgrep has session history, small customisable QT C++ GPL source,
ability to filter and refine searches, quicker preview than launching vi,
but not as many options as gnu grep and gnu find.

Alternatives

GNU emacs has grep-find, delete-matching-lines,dired
GVIM has :grep, filter :v/keep/d :g/filter/d,preview, gf (edit file).
GNU BASH : find dir -prune skip | grep keep | grep -v ignore | xargs grep text | gvim -
CYGWIN for windows comes with all the gnu tools and X server!
OPERA look for your files on google.com, it works.

0 Comments:

Post a Comment

<< Home