• Login
Community
  • Login

replacing all in line with veried numbers1

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.
  • D
    darkfang1989
    last edited by Sep 8, 2024, 12:51 AM

    playing a zombie game and they use XML to change alot of their options. (vanilla and modded) i’m trying to remove the spawn chance of a zombie but all the chances are in different numbers… and there’s nearly 600 of them. how do i use the replace function to change all the chances to 0, with each line having a different chance number?

    M 1 Reply Last reply Sep 8, 2024, 12:59 AM Reply Quote 0
    • M
      Mark Olson @darkfang1989
      last edited by Sep 8, 2024, 12:59 AM

      @darkfang1989 said in replacing all in line with veried numbers1:

      how do i use the replace function to change all the chances to 0, with each line having a different chance number?

      You haven’t provided nearly enough information for anybody to help you.

      I recommend that you provide a short example (maybe a small XML snippet containing four elements that you want to change) of what your file will initially look like and what it should look like at the end. Read the FAQ on formatting forum posts for guidance.

      D 1 Reply Last reply Sep 8, 2024, 1:05 AM Reply Quote 1
      • D
        darkfang1989 @Mark Olson
        last edited by darkfang1989 Sep 8, 2024, 1:06 AM Sep 8, 2024, 1:05 AM

        @Mark-Olson

        <csv xpath="/entitygroups/entitygroup[@name='sleeperHordeStageGS332']/text()" delim="\n" op="add" >
        	zombieFatHawaiianElite, .24
        	zombieFemaleFatElite, .24
        	zombieHazmatElite, .39
        	zombieLumberjackElite, .39
        	zombieSoldierElite, .39
        	zombieLabElite, .58
        	zombieSpiderElite, .58
        

        this is one of the blocks, all blocks having different numbers. i would like to know if there’s a way to change the “zombieSpiderElite, .58” number in each block despite the number being different in each one.

        C 1 Reply Last reply Sep 8, 2024, 1:38 AM Reply Quote 0
        • C
          Coises @darkfang1989
          last edited by Sep 8, 2024, 1:38 AM

          @darkfang1989 said in replacing all in line with veried numbers1:

          @Mark-Olson

          <csv xpath=“/entitygroups/entitygroup[@name=‘sleeperHordeStageGS332’]/text()” delim=“\n” op=“add” >
          zombieFatHawaiianElite, .24
          zombieFemaleFatElite, .24
          zombieHazmatElite, .39
          zombieLumberjackElite, .39
          zombieSoldierElite, .39
          zombieLabElite, .58
          zombieSpiderElite, .58

          this is one of the blocks, all blocks having different numbers. i would like to know if there’s a way to change the “zombieSpiderElite, .58” number in each block despite the number being different in each one.

          You can use regular expression replacement to do that. From the main menu, select Search | Replace…, then enter:

          Find what: (?<=zombieSpiderElite,)\s*[.\d]+
          Replace with: .00 (note: there is a space before the period, but you can’t see it here)
          Wrap around: checked
          Search Mode: Regular expression

          and click the Replace All button.

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