• Login
Community
  • Login

Add Increment Number End Of Word

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 533 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.
  • B
    B.HaikaL
    last edited by Feb 3, 2021, 2:22 AM

    Hi, new here and seeking for help. I want to add numbers at the end of this word > valueMe

    <tr>
    <td>TITLE</td>
    <td><input class=“inputB” value=“” id=“valueMe” ></input></td>
    <td><input class=“inputB” value=“” id=“valueMe” ></input></td>
    <td><input class=“inputB” value=“” id=“valueMe” ></input></td>
    </tr>
    <tr>
    <td>TITLE2</td>
    <td><input class=“inputB” value=“” id=“valueMe” ></input></td>
    <td><input class=“inputB” value=“” id=“valueMe” ></input></td>
    <td><input class=“inputB” value=“” id=“valueMe” ></input></td>
    </tr>

    Using ALT + SHIFT not working for this, there will be numbers in the empty lines instead of behind the text valueMe.

    Does this can be done in Notepad++? I want it to be like this:

    <tr>
    <td>TITLE</td>
    <td><input class=“inputB” value=“” id=“valueMe1” ></input></td>
    <td><input class=“inputB” value=“” id=“valueMe2” ></input></td>
    <td><input class=“inputB” value=“” id=“valueMe3” ></input></td>
    </tr>
    <tr>
    <td>TITLE2</td>
    <td><input class=“inputB” value=“” id=“valueMe4” ></input></td>
    <td><input class=“inputB” value=“” id=“valueMe5” ></input></td>
    <td><input class=“inputB” value=“” id=“valueMe6” ></input></td>
    </tr>

    Thanks,

    1 Reply Last reply Reply Quote 0
    • T
      Terry R
      last edited by Terry R Feb 3, 2021, 2:36 AM Feb 3, 2021, 2:35 AM

      @Bot-Spaces said in Add Increment Number End Of Word:

      I want to add numbers at the end of this word

      Yes, but not easily with a regular expression (regex) and the use of the “number to insert” available under the “Edit” menu, Column Editor.

      One idea would entail adding a whole lot of numbers to the end of the file, then cutting off a number and inserting it behind the next “valueMe” string. The regex to perform this cut and paste would need to run for as many of the strings that occur. All up a considerable amount of work.

      However by using one of the supporting scripting languages (Pythonscript tops that list) someone who was proficient in that might be able to conjure up a quick few lines of code to do it. That’s not me, although I do believe there are various snippets of code already supplied in this forum, that if one looked for them they could be easily adapted to solve this.

      Terry

      1 Reply Last reply Reply Quote 2
      • T
        Terry R
        last edited by Feb 3, 2021, 2:46 AM

        @Terry-R said in Add Increment Number End Of Word:

        although I do believe there are various snippets of code already supplied in this forum, that if one looked for them they could be easily adapted to solve this.

        It turned out that such a question has already been answered and I was involved in an alternate solution using only regex (not recommended as much massaging of the data). Have a look at:
        https://community.notepad-plus-plus.org/topic/20462/how-to-append-the-numbers-with-specific-string
        See if it helps in any way.

        Cheers
        Terry

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