Community
    • Login

    Advanced "Replace" function

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 4.5k 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.
    • ModsWantedM Offline
      ModsWanted
      last edited by

      Hello guys!

      Great to find such a nice forum for N++ maybe I might find some information concerning my issue here.
      I think the search and replace funtion in N++ is really great but sometimes I feel like there is missing an option… or I have no idea how to use it properly. But after studiing the help files and some internet searching I’m still kind of stupid.

      Here is an example of what I’m trying to do.
      For example I have an XML file and need to find a word/expression. If this word/expression is found I need to search in the same line for a second word/expression and replace it by something else.

      For example: Search for “LargeRock02”

      • <Shape shapeId=“168” name=“LargeRock02” translation=“-11.197 -1.40177 6.79036” rotation=“0 60.9952 1.04951e-013” scale=“0.1 0.1 0.1” static=“true” clipDistance=“800” nodeId=“5546” materialIds=“14” castsShadows=“true” receiveShadows=“true”/>

      When it’s found search for materialIds=“14” when found, replace by for example materialIds=“32”

      I hope I explained it easy to understand and hope you guys could give me a hint of what I’m doing wrong in the search/replace tool or if it is even possible to do such a thing. I tried some Plugins like “Analyse Plugin” but it didn’t give me the function I’m looking for.

      Thanks a lot in advance guys and please keep up the great work!
      Cheers, mailman

      1 Reply Last reply Reply Quote 0
      • ModsWantedM Offline
        ModsWanted
        last edited by

        PUSH PUSH :-D nobody a suggestion?

        1 Reply Last reply Reply Quote 0
        • dailD Offline
          dail
          last edited by

          The PythonScript plugin could do it (with the requirement you know Python) or just use a regular expression

          Search for
          (LargeRock02.+?materialIds=")14

          Replace with
          \132

          1 Reply Last reply Reply Quote 0

          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