• Login
Community
  • Login

Replace folder path using wildcard

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 2 Posters 551 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.
  • J
    jonnieg4rdner
    last edited by Jun 22, 2023, 9:46 AM

    Hi,
    I am looking to search/replaces in files, I want to use a wildcard to identify the folder path and replace it with a common path, this will allow me to delete all other copies of a file from the server.

    Search path
    K:*********\D_V562X-5.stl (wildcard path)

    Replacement path
    K:\Temp\D_V562X-5.stl (common path

    I only have basic knowledge of notepad++ so it will need spelling out to me 🤣

    Thanks in advance

    A 1 Reply Last reply Jun 22, 2023, 10:47 AM Reply Quote 0
    • A
      Alan Kilborn @jonnieg4rdner
      last edited by Jun 22, 2023, 10:47 AM

      @jonnieg4rdner said in Replace folder path using wildcard:

      Try:

      Find: (?-s)^K:\\.*\\D_V562X-5.stl
      Replace: K:\\Temp\\D_V562X-5.stl
      Search mode: Regular expression

      Learn more HERE.

      J 1 Reply Last reply Jun 22, 2023, 11:04 AM Reply Quote 2
      • J
        jonnieg4rdner @Alan Kilborn
        last edited by Jun 22, 2023, 11:04 AM

        @Alan-Kilborn said in Replace folder path using wildcard:

        K:\Temp\D_V562X-5.stl

        Hi Alan,
        Thanks for getting back to me but your suggestion isnt working, some of the paths will have spaces, hyphens and maybe underscores (not sure if this is relevant)
        I have shortened the folder length but the format below is correct, not sure if having <File> at the start and </File) at the end makes a difference.

        <File>K:\Customers\A B\PROJECT\Data\12 3-4\V\D_V562X-1.stl</File>

        Thanks

        A 1 Reply Last reply Jun 22, 2023, 11:07 AM Reply Quote 0
        • A
          Alan Kilborn @jonnieg4rdner
          last edited by Jun 22, 2023, 11:07 AM

          @jonnieg4rdner

          Probably just remove the ^ from my Find expression.

          See more about posting search-and-replace questions HERE.

          J 1 Reply Last reply Jun 22, 2023, 12:02 PM Reply Quote 2
          • J
            jonnieg4rdner @Alan Kilborn
            last edited by Jun 22, 2023, 12:02 PM

            @Alan-Kilborn Perfect!!!

            Thanks for your help.

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