Grep with Everything!

Plug-in and third party software discussion.
Post Reply
gserack
Posts: 7
Joined: Wed Jan 20, 2010 10:48 pm

Grep with Everything!

Post by gserack »

For those who use the command-line grep tool ported by Tim Charron http://pages.interlog.com/~tcharron/grep.html on Windows, I've updated it so that it can search for files using an everything query:

http://coapp.org/@api/deki/files/6/=gre ... ything.zip

I've added a switch ( -Z ) that lets you do this:

Code: Select all

grep -i -Z foo.*bar  files*.txt 
this will get the list of files to grep thru from Everything and perform the grep operation on the results.
therube
Posts: 4985
Joined: Thu Sep 03, 2009 6:48 pm

Re: Grep with Everything!

Post by therube »

Neat. (I've only looked at this briefly so far.)

So ...

Code: Select all

grep   -Z <grep search string>   <everything search>
First instance search for the string "manual" within files named "arj txt".
Second find instances where the search string "manual" was NOT (-L) found in files named "arj txt".

Image
gserack
Posts: 7
Joined: Wed Jan 20, 2010 10:48 pm

Re: Grep with Everything!

Post by gserack »

Glad you like it :D

I use this new grep so much now, I'm completely stunned.

:D
ambimind
Posts: 6
Joined: Mon Feb 08, 2010 5:30 am

Re: Grep with Everything!

Post by ambimind »

Nice work gserack. Have been doing this with batch files for a long time, this will make it much easier.
I'd first use the command-line version of "everthing" and ">" the results to a text file. Then GNU grep would take its cue of which files to search from this text file.
I also do this with GNU "sed" for modifing lists of files, would be great to have a -Z for "sed" also.

Cheers!
jeroenp
Posts: 5
Joined: Wed Dec 15, 2010 1:19 pm

Re: Grep with Everything!

Post by jeroenp »

Here this grep always fails.

OS: Windows 7 Ultimate x64
tried both a cmd prompt as normal and as administrator mode.

C:\bin>grep -Z nullabletypes-*.txt com

If I turn the search arguments around, then it waits forever in administrator mode, and still crashes in non-administrator mode:

C:\bin>grep -Z com nullabletypes-*.txt

(yes, there are files named like nullabletypes-*.txt)

The crash is consistent:

Problem signature:
Problem Event Name: BEX
Application Name: grep.exe
Application Version: 0.0.0.0
Application Timestamp: 4cd053b2
Fault Module Name: grep.exe
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4cd053b2
Exception Offset: 0001712f
Exception Code: c0000417
Exception Data: 00000000
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 1033
Additional Information 1: b389
Additional Information 2: b3895b5bdc4892443cdb0226543f9d84
Additional Information 3: 09c8
Additional Information 4: 09c84ea14ae3f6b1d8189ee98377b1e5

Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid= ... cid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
Post Reply