Is it possible to automate Notepad++, specifically the search and replace across files?

15,230

There's so many ways for achieving this. I'll stick to the ones that uses Notepad++ for now

  1. Notepad++ > Search > Find in Files and go from there adjust the mask or make backups, and read your option this WILL replace all files in sub folders by default

    OR

  2. for more advanced search and replace Notepad++ > Plugins > Plugin Manager > Show Plugin Manager now search for and Install "Python Script" read here for more. This require some basic coding skills or you'll need to read and test for a while.


if you're looking for a command-line tool you can use fnr.exe - Find And Replace Tool, It's a simple and effective Open source tool It's portable, free, lightweight and more Stable than basic codes that we may create.

Share:
15,230

Related videos on Youtube

kailash gaur
Author by

kailash gaur

Contracting in anything interesting with Microsoft technologies, primarily middle/back-end in C#, BizTalk, Azure, SQL Server, WCF, SSIS, etc. Currently working at Wokingham Borough Council on integrations using Dynamics CRM Online, Azure Service Bus and various back office systems. Please feel free to contact me if you've got an interesting project ...

Updated on September 18, 2022

Comments

  • kailash gaur
    kailash gaur almost 2 years

    Is it possible to automate Notepad++, specifically the search and replace across files?

    I want to be able to automate the search and replacement of placeholder values across a number of file types, e.g. .config and .pubxml, and rather than write PowerShell script, I'd prefer to use the ready built (and tested) functionality in Notepad++

    • kailash gaur
      kailash gaur over 8 years
      @PJMahoney Yeah, but I find UI automation a bit on the brittle side ... I was hoping for an accessible API for driving N++ through PowerShell or the like
  • kailash gaur
    kailash gaur over 8 years
    Thanks for the pointer to item 2. I don't think item 1 is a valid answer, as it's purely manual, which I already do. I wanted to automate the process.
  • Maher Fattouh
    Maher Fattouh over 8 years
    Please note that option number 1 will find and replace text of ALL FILES in a folder and sub folders and will save the modified files automatically.
  • Maher Fattouh
    Maher Fattouh over 8 years
    Updated Answer.