Any grep like program that can do this?

  • Thread starter Thread starter Traveler
  • Start date Start date
T

Traveler

Hello,

I am looking for a small fast exe program that's can search
recursively large number of files for couple of words and return total
number of occurrence it found in all files?

if anything like is available?

Thank you
 
Hello,

I am looking for a small fast exe program that's can search
recursively large number of files for couple of words and return total
number of occurrence it found in all files?

if anything like is available?

Since you mention grep, I'm guessing you're a *nix fan. If so, you may
be interested in UnxUtils:

http://unxutils.sourceforge.net/

"Here are some ports of common GNU utilities to native Win32. In this
context, native means the executables do only depend on the Microsoft
C-runtime (msvcrt.dll) and not an emulation layer like that provided by
Cygwin tools"

The only standard tool I didn't find in there was strings. I think
it's www.sysinternals.com that has a version of strings for
Windows. It even has a unicode option.
 
Traveler said:
I am looking for a small fast exe program that's can search
recursively large number of files for couple of words and return
total number of occurrence it found in all files?

if anything like is available?

You can do a grep but I don't think you'll get the output you desire.

Searching for the words "input" and "output" something like:

grep -c -r " input\|output" *.* | grep -v ":0"

You won't get total tally, only count of matches per file.
(See below for example grep output)


You may want to check out MiniTrue <http://www.idiotsdelight.net/minitrue/>

A search and replace type utility which will also give an output you may desire.

Again searching for the words "input" and "output".

mtr -akn -r# *.* - input output

Here is the minitrue output:


String(s) Finds Replacements
input 813 -
output 1160 -

File
agrep.exe 148 0
base64.exe 4 0
bash.exe 1 0

<snip>

zcat.exe 7 0
zip.exe 7 0
4dos\4dos.com 7 0
4dos\4dos.hlp 5 0
4dos\intro.txt 7 0
4dos\option.exe 9 0
doc\agrep.txt 6 0
doc\aset10.txt 16 0

<snip>

doc\xrd.txt 2 0
doc\xset.txt 48 0

<snip>

doc\blat-d~1\blatcgi.txt 10 0
doc\blat-d~1\blathelp.txt 2 0
doc\blat-d~1\change~1.txt 1 0

<snip>

doc\curl-d~1\curl-hlp.txt 10 0
doc\curl-d~1\curl-man.txt 36 0
doc\curl-d~1\curl~1.htm 25 0

Total: 1973 0
Total Files Scanned: 325
Total Bytes Scanned: 17573683
Time Elapsed: 3.35 sec



Here is the grep output:

4DOS/4DOS.COM:1
4DOS/BATCOMP.EXE:2
4DOS/EXAMPLES.BTM:2
4DOS/INTRO.TXT:6
AGREP.EXE:12
BASE64.EXE:3
BAT2EXE.COM:1
BLAT.EXE:2

<snip>

DIRDATE.EXE:1
DIRNAME.EXE:2
doc/GREP.TXT:10
doc/SED.TXT:5
doc/SDIFF.TXT:4

<snip>

doc/MAKECAB.TXT:6
doc/WGET.HLP:1
doc/EGREP.TXT:8
doc/HUNT.TXT:8
doc/MSMTP.HTML:4
doc/curl-docs/MANUAL:5
doc/curl-docs/TheArtOfHttpScripting:2
doc/curl-docs/FAQ:4

<snip>

doc/blat-docs/syntax.txt:2
doc/blat-docs/cgi/blat-cgi.htm:1
doc/blat-docs/blathelp.txt:2
doc/XSET.TXT:40
doc/COLS.TXT:11
doc/WGET.TXT:6

<snip>

doc/TAIL.TXT:8
doc/RUNPROCESS.TXT:3
doc/HEAD.TXT:3
doc/CAT.TXT:5
doc/GUNZIP.TXT:3
EGREP.EXE:10
ERASERD.EXE:4
EXPR.EXE:2
FACTOR.EXE:3

<snip>

ZCAT.EXE:4
ZIP.EXE:5
 
Back
Top