• Login
Community
  • Login

How do I increase numbers by one

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
regexhtml encoding
4 Posts 2 Posters 383 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
    dr ramaanand
    last edited by dr ramaanand Feb 6, 2024, 7:37 PM Feb 6, 2024, 5:25 PM

    How do I increase numbers by one for this set of numbers? :-

    <sup>[0]</sup>
    <sup>[1]</sup>
    <sup>[2]</sup>
    <sup>[3]</sup>
    <sup>[4]</sup>
    <sup>[5]</sup>
    <sup>[6]</sup>
    <sup>[7[</sup>
    <sup>[8]</sup>
    <sup>[9]</sup>
    <sup>[10]</sup>
    <sup>[11]</sup>
    

    The output should be:-

    <sup>[1]</sup>
    <sup>[2]</sup>
    <sup>[3]</sup>
    <sup>[4]</sup>
    <sup>[5]</sup>
    <sup>[6]</sup>
    <sup>[7[</sup>
    <sup>[8]</sup>
    <sup>[9]</sup>
    <sup>[10]</sup>
    <sup>[11]</sup>
    <sup>[12]</sup>
    
    P 1 Reply Last reply Feb 6, 2024, 5:26 PM Reply Quote 0
    • P
      PeterJones @dr ramaanand
      last edited by PeterJones Feb 6, 2024, 5:27 PM Feb 6, 2024, 5:26 PM

      @dr-ramaanand ,

      https://community.notepad-plus-plus.org/topic/23170/faq-can-i-do-a-mathematical-replacement

      You’ve been here long enough to know to check the FAQs. “ADD A VALUE TO EACH MATCH” is literally the first example for the PythonScript solutions in that FAQ.

      D 1 Reply Last reply Feb 6, 2024, 7:24 PM Reply Quote 0
      • D
        dr ramaanand @PeterJones
        last edited by dr ramaanand Feb 6, 2024, 7:27 PM Feb 6, 2024, 7:24 PM

        @PeterJones Okay, thank you.
        I think this will work for me:-
        REPLACE WITH A SIMPLE COUNTER (I.E., RENUMBERING)
        Plugins > Columns++ > Search…
        Find what : <sup>[(\d+)
        Replace with : <sup>[(?=match)
        I will try it tomorrow
        For those who arrive at this webpage by searching online, let me tell you that I am expecting a result like this:-

        <sup>[1]</sup>
        <sup>[2]</sup>
        <sup>[3]</sup>
        <sup>[4]</sup>
        <sup>[5]</sup>
        <sup>[6]</sup>
        <sup>[7[</sup>
        <sup>[8]</sup>
        <sup>[9]</sup>
        <sup>[10]</sup>
        <sup>[11]</sup>
        <sup>[12]</sup>
        
        D 1 Reply Last reply Feb 8, 2024, 7:40 PM Reply Quote 0
        • D
          dr ramaanand @dr ramaanand
          last edited by Feb 8, 2024, 7:40 PM

          @PeterJones I was finally able to increase the numbers by one, using the methods you elucidated at, “How to install and run a script in Python Script”. Thanks a lot!

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