Community
    • Login

    need help replacing multiple "answers" to these lines?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 217 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.
    • Chrismatt DC
      Chrismatt D
      last edited by

      Hello, im completely new to NotePad++, and i need help figuring out how to change this all at once. i dont want to sit here and do it all individually lol.

      im using a minecraft mod config file and i want to change all the, for example,
      “stamina”: 1200

      to
      “stamina”: 9999

      or,
      “speedModifier”: 1.5,

      to
      “speedModifier”: 2,

      all of the “speedModifier” tokens (I think thats what theyre called) to 2, and all the “stamina” to 9999.

      heres an example snip.
      801693cb-73c1-496d-85ca-33fd52485b01-image.png

      Help please!!

      Thomas KnoefelT 1 Reply Last reply Reply Quote 0
      • Thomas KnoefelT
        Thomas Knoefel @Chrismatt D
        last edited by Thomas Knoefel

        @Chrismatt-D

        You have to enable “Regular expression” in Replace and you will add
        Find what: "stamina":\s*\d+
        Replace with: "stamina": 9999

        Find what: "speedModifier":\s*\d+(\.\d+)?
        Replace with: "speedModifier": 2

        You can do each replacement separately, or manage all replacements in a list using the MultiReplace plugin.

        Chrismatt DC 1 Reply Last reply Reply Quote 3
        • Chrismatt DC
          Chrismatt D @Thomas Knoefel
          last edited by

          @Thomas-Knoefel said in need help replacing multiple "answers" to these lines?:

          Find what: “speedModifier”:\s*\d+(.\d+)?

          THANK YOU SO MUCH!

          1 Reply Last reply Reply Quote 1
          • Mark OlsonM
            Mark Olson
            last edited by

            You might also be able to achieve this with the query

            @..stamina = 9999;
            @..speedModifier = 2
            

            in the JsonTools plugin.

            In this case a regex-based solution as described by Thomas Knoefel will work fine, but if you want more control over how you manipulate your JSON, a JSON parser like JsonTools is likely a better option.

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