3

is there any way to make Multiple Find and Replace in Notepad++ in the same time.

I am using regular expression to find and replace.

I have large number of files and I need to find and replace 10 items for each files.

2
  • 3
    No. You have to do them one after another.
    – DavidPostill
    Commented Feb 26, 2017 at 17:56
  • May it can be done by Notepad++ macro? Commented Feb 26, 2017 at 18:51

3 Answers 3

1

I'm a fairly new to Notepad++ but I've had success in doing this using a macro:

  • Open your file
  • Hit Macro > Start recording
  • ctrl + F: find and replace first item, find + replace second, third, N-items
  • Hit Macro > Stop recording
  • Hit Macro > Save recording and give it a good name and possibly shortcut

To run the macro:

  • Open your file
  • Hit Macro > and select your saved macro / or use the shortcut you choose
0

I depends on exactly what you want to find and replace.

Search and replace is rather limited in Notepad++, and there is currently no way to perform multiple search and replace operations at the same time.

But your can get creative if your needs fall within the current limitations of Notepad++.

If you want to find multiple different strings and replace them with the same (or similar) strings, you can use regular expressions. In the simplest form, you can add a pipe symbol in a regex, and it will act as an "or" operator.

For example, you can specify regular expression search and search for: foo|bar

For your replacement string, use whatever you like. For example: baz

Now when you perform your search, it will replace all foos and bars with baz.

You can even get a littler fancier and search for something like: (f)oo|ba(r)

This time, for your replacement string, use $1$2az.

Now all foos will be replaced with faz and all bars will be replaced with raz.

1
  • Downvoter, any reason for the downvote and what would improve this answer? Or is this just the usual troll? We both know who you are. Commented Jun 29, 2021 at 0:56
0

This worked for me:

  1. Click record macro button
  2. Press Ctrl+F
  3. Search the term you're looking to find
  4. After finding the term, press Escape on your keyboard
  5. Do the actions you desire to do around the found term.
  6. Stop recording Macro
  7. Run the macro you just recorded as many times as needed.

I was looking to get a list of text surrounded by a specific HTML tag. This is what worked for me, hope this helps!

You must log in to answer this question.

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