Community
    • Login

    Replace folder path using wildcard

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 549 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.
    • jonnieg4rdnerJ
      jonnieg4rdner
      last edited by

      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

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @jonnieg4rdner
        last edited by

        @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.

        jonnieg4rdnerJ 1 Reply Last reply Reply Quote 2
        • jonnieg4rdnerJ
          jonnieg4rdner @Alan Kilborn
          last edited by

          @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

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn @jonnieg4rdner
            last edited by

            @jonnieg4rdner

            Probably just remove the ^ from my Find expression.

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

            jonnieg4rdnerJ 1 Reply Last reply Reply Quote 2
            • jonnieg4rdnerJ
              jonnieg4rdner @Alan Kilborn
              last edited by

              @Alan-Kilborn Perfect!!!

              Thanks for your help.

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