I have a few thousand files that I need to search and replace. Is there a software that can open a directory of files, scan those files and then search and replace? I'm aware that you can script something like this. However, I have no interest and prefer to use something that is already made.

link|improve this question

1  
which OS do you use? – akira Oct 23 '11 at 5:37
feedback

2 Answers

up vote 3 down vote accepted

If you're using Linux you can pipe the results of a find command into sed to perform the replace.

find . -name '*.txt' -print0 | xargs -0 sed -i 's/searchpattern/replacepattern/'

This will find every file in your current directory and below (. is your current directory) and replace instances of searchpattern with replacepattern.

link|improve this answer
feedback

If you're using Windows, you could try to use NotePad++.
There's a tab in its Replace window that scans for files in a folder (you can choose an extension to filter) and do search/replace automatically.

Just note that doing thousands of files can take a very long time. This depends on the specifications of your computer. Just ensure you have a backup of the files you are going to find and replace in case Notepad ++ crashes and you lose data.

link|improve this answer
Strange. I contributed to the second part of the answer and it says Diago did it. – Sam Oct 23 '11 at 11:11
@Sam: looking at the edits history, I saw you put your contribute right after mine, without blank lines. Diago fixed it. Thanks to everybody who made my answer better, thanks a lot!! – Marco Oct 23 '11 at 11:41
feedback

Your Answer

 
or
required, but never shown

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