Community
    • Login

    need help replacing multiple "answers" to these lines?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 678 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.
    • Chrismatt DC Offline
      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 Offline
        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 Offline
          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 Offline
            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

            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