Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 was marked as an exact duplicate of an existing question.

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .