which editor will open files in succession

I am looking for the easy way to examine grep finds.  I often grep for an expression in a bunch (~30) of programming files.  I then go through the list of results and look at each of them to see if they are important to me.  Ozo (EE guy) told me yesterday how to use awk to print out the line number and file name of all of the files that have an expression that I'm looking for.  I thought that I could pipe this into vi and automatically look through all of the files to see if one has what I was looking for.  Unfortunately vi only goes to the line number for the first file in a list.  Does anyone know how to automatically look through a bunch of files that have the expression that you're looking for in them?  I'm not picky about which editor I'm using.

Thanks
dwcroninAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
emacs [+linenumber] file [+linenumber] file ...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ahoffmannCommented:
vi +42 file
vi +/pattern/ file
dwcroninAuthor Commented:
ahoffmann,
Yes you can do that to get to line 42 of "file" or to find "pattern" in "file" but the problem is that I wanted to automatically go to specific lines of various file.  I thought that I could use:

vi +line_file1 file1 +line_file2 file2

It turns out that vi will only go to the specified line of file1.  For the rest of the files, it goes to the beginning.  I'm going to go check out Ozo's answer.
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

fridomCEO/ProgrammerCommented:
run grep within Emacs and you get a buffer with all results. Just go into that buffer and klick on the proper place and emacs will go there.

Regards
Friedrich
ahoffmannCommented:
# if you're not adicted to emacs: quick&dirty and to be improved in many ways:)
grep -n -s pattern list of files|awk -F: '{print "vi +"$2" "$1}'|sh
# or
gawk /pattern/'{print "vi +"FNR" "FILENAME}' list of files|sh
Prashant SabnekarAVPCommented:
One more new editor is there called Anjuta, where you can use its menu to find a particular string in multiple files.

Regards
Prashant Sabnekar
Prashant SabnekarAVPCommented:
anjuta.sourceforge.net
This is the URL to the Anjuta editors Home Page

Regards
Prashant Sabnekar
ahoffmannCommented:
> .. menu to find a particular string in multiple files.
that's what vi can do since roughly 30 years with a simple key-stroke
prashantsabnekar, no offence but SCNR ;-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.