How To “Find And Replace” Words In Multiple Files

Ads by Google

find-and-replace-textI have been using Notepad ++ for years as my Windows Notepad replacement.

It does highlighting and line numbers, these were my first reasons for using it. Notepad ++ has been my best friend for writing scripts and HTML files.

Now I had a new challenge and my buddy Mike told me that Notepad ++ would be my easiest and FREE solution.

Here was my dilemma – I had 8,342 HTML files and I needed to replace some text on every single page to reflect a company’s identity tweaking. The company was mostly adult-oriented before and now they are trying their hand at mainstream. They needed to remove the word ADULT from their company name every where throughout their site. Now your friendly neighborhood admin was not going to be doing this manually – that was for sure. So I fired up Notepad ++ and searched for this magic option.

Sure enough there it was on the search menu – the option that was going to make my life easier – “Find In Files”.

Using this awesome feature I am able to have Notepad++ find all files with the word I choose in them. It then shows me the results of my search. Once I click on all the instances I want to change, it will open those files. I can then do my “replace on all open files”.

find and replace tool

find and replace files

After you find all your instances and have all the files open in Notepad ++ you can then click over to the replace tab – now you will see a option to replace throughout ALL OPENED FILES! Sweet!

Ads by Google

I am guessing that some of you out there have never heard of or used Notepad ++ before. So let me run down the basic features with you. If you are a scripter, coder or any type of programing monkey this program will make you salivate!

Check it out, Notepad ++ has:

  • Syntax Highlighting and Syntax Folding
  • WYSIWYG
  • User Defined Syntax Highlighting
  • Auto-completion
  • Regular Expression Search/Replace supported
  • Full Drag “˜N’ Drop supported
  • Multi-Language environment supported
  • Brace and Indent guideline Highlighting
  • Macro recording and playback
  • Bookmarks

Do you have another way to find and replace throughout a slew of files? After completing this task I was told about another free application that might have made my life even easier… It is called BkReplaceEm and stay tuned for my review!

Ads by Google
Comments (22)
  • Luis

    A long time ago, some smart folks thought about this problem (and other similar problems) and asked themselves the question: would it be better to have a lot of commands and tools for each type of task, or would it be better to have just a tiny set of tools that do just a couple of things each, and can be organized in a sequence, in different ways, so that you can solve lots of different problems? (kind of like lego pieces). They decided the little tools was a better idea. This was so good, that even after 40 years of advances in computing no one has come with anything better. If you learn those tools, you will be able to solve a large number of things, almost like magic. To do it: download Cygwin, and install/learn sed and awk (very simple to do) and learn about pipes ( | )

  • Amanda Sellers

    I just ran across this when I was looking for a way to batch edit text files. We use a program that creates them, but they need to be modified before they can be sent to our shop. This worked perfectly for what I need to do and I already had Notepad++ on my PC. It’s also going to help some co-workers save some time as well. Thank you!

  • kenny , scotland

    Actually Dreamweaver does this with a large site of html files. but it wouldnt work with pure text files when i tried it.

    Well they were really .ahk files for auto hot keys.

    Been using Dreamweaver for years to manage 1500+ html files and it is just great at find / replace over entire current local site….

    Going to try the notepad + option for my text files ….

    I have some changes needed in about 60 text files, and was looking for an easy option.

    Thats how I found this old entry…. but someone might find it useful..

  • Ashley Thomas

    OhMyGod I Love You!
    I was so stressed out because I got a new website, and I had to change all my links,
    but this program did it in like 10 seconds!
    Thank you so much!

  • Andy

    To open many documents for the bulk find replace functionality use File > Open. Then when the file manager window comes up, highlight all the documents you want to edit. Once that is done, then you can follow Karl’s steps above.

Load 10 more
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.