Community
    • Login

    Advanced "Replace" function

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

        PUSH PUSH :-D nobody a suggestion?

        1 Reply Last reply Reply Quote 0
        • dailD
          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
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors