Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by Ƭᴇcʜιᴇ007, surfasb, 8088, Mehper C. Palavuzlar, Sathya 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.

3 Answers 3

up vote 0 down vote accepted

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

share|improve this answer

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

share|improve this answer

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

share|improve this answer

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