Possible Duplicate:
Editor with muti-line search and replace

I'm looking for (ideally free) software, which will perform selective search and replace on multiple text files.

So I want to search for a phrase and have it show all the lines which it occurs in all the files. I want to be able to select those lines and click replace.

Kind of like a preview before I commit the changes to the selected lines.

marked as duplicate by Ƭᴇcʜιᴇ007, surfasb, 3498DB, Mehper C. Palavuzlar, Sathyajith Bhat Nov 11 '11 at 9:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Step 1: show all lines that will be changed

grep search-pattern file1 file2 file3

Step 2: go ahead

perl -p -i -e 's/search-pattern/replacement' file1 file2 file3

You could use awk instead of perl.

Grep and awk are in GnuWIn32. Perl can be obtained from Strawberry or ActiveState


Have you considered SciTE? It handles searching in multiple files quite gracefully and is completely free.


Wow, SciTE looks pretty sweet... Word_SR is a nice one if you have MS Word and you want to search across anything Word can edit. They have one for Excel and PPT, too. It's free. http://www.funduc.com/word_sr.htm

Not the answer you're looking for? Browse other questions tagged or ask your own question.