Community
    • Login

    Find results - Copy name of files (without hits)

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 465 Views 1 Watching
    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.
    • Vasile CarausV Offline
      Vasile Caraus
      last edited by

      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
      • guy038G Offline
        guy038
        last edited by guy038

        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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors