help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep and sort


From: David Combs
Subject: Re: grep and sort
Date: Wed, 08 Dec 2010 15:27:35 -0000

Not as a solution to this problem, but related to using
grep and getting an *Occur* like buffer.


Say I want to do a grep-like operation, but then
further filter it or process it in some way,
and M-x grep doesn't do just what I want.

Add in that I'm doing this on more than one file,
but want to be able to click-then-be-taken-to
in one long file.  Well, like this:

So, I use the grep *program*, 

egrep -n -H  regexp   file file file ... > loc.txt

and maybe in that, for easier viewing, I upper-case
some words, like print --> PRINT, etc.

Now, that -H gave me the filenames:

foo.txt:480:Hello there
foo.txt:9010:what are you doing here?
bar.txt:22:yada yada here yada
... 
etc.

That's what's in loc.txt.

THEN, in emacs, I do M-x get
and instead of filling in a regexp or whatever,
I give it this string:   cat loc.txt


Works like a charm!


David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]