• Login
Community
  • Login

Find results - Copy name of files (without hits)

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
2 Posts 2 Posters 250 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V
    Vasile Caraus
    last edited by Oct 1, 2019, 3:27 PM

    hello. I want to find results on “search in files” option, copy name of files (without hits result), and to delete those files. How can I do that?

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by guy038 Oct 23, 2019, 11:44 AM Oct 19, 2019, 10:15 PM

      Hello @vasile-caraus and All,

      Not very difficult, indeed !

      • Do your search in files ( Ctrl + Shift + F )

      • Once the Find Result panel opened, right-click inside and choose the option Select all

      • Hit the shortcut Ctrl + C ( Do NOT use the Copy option of the context menu ! )

      • Open a new tab ( Ctrl + N )

      • Paste the clipboard ( Ctrl + V )

      • Now, in that new file, perform the following regex S/R :

      • SEARCH (?-si)^(?:(Search).+|\x20\x20(.+)\(.+?\)$|\t.+\R)

      • REPLACE (?1echo @OFF)(?2Del\x20\2\x20/p)

      • Save this new file, in your N++ directory, as, let’s say Suppression.bat

      • Execute the option Run > Run... ( of hit the F5 key )

      • Type in the command cmd /k Suppression.bat

      • Valid the suppression of each file, by answering y

      • Close the DOS window

      Et voilà !


      Remark : If your prefer to delete all files in one go, change the Replace zone as (?1echo @OFF)(?2Del\x20\2)

      Best Regards,

      guy038

      1 Reply Last reply Reply Quote 2
      • First post
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors