Community
    • Login

    how to append the numbers with specific string ??

    Scheduled Pinned Locked Moved General Discussion
    5 Posts 3 Posters 1.0k Views 2 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.
    • kamal lochanK Offline
      kamal lochan
      last edited by

      hfshfdohoh kamal from which build the issue is comming need to check it out .
      nscknkjnkjdnjknnkjnjd jnnfdnfn kamal from which build the issue is comming need to check it out .
      nndnfdoihiofdhoifdhoi dnidihdi nindiididkamal from which build the issue is comming need to check it out .
      jbffbufb kamal from which build the issue is comming need to check it out .
      hfhfjfj kamal from whickamal from which build the issue is comming need to check it out .
      nidididn kamal from which build the issue is comming need to check it out .
      nnidnid kamal from which build the issue is comming need to check it out .

      in the above text ,wherever kamal is there ,kamal 1 ,kamal 2 ,kamal 3 should come …so out put text should be :-

      output text:

      hfshfdohoh kamal1 from which build the issue is comming need to check it out .
      nscknkjnkjdnjknnkjnjd jnnfdnfn kamal2 from which build the issue is comming need to check it out .
      nndnfdoihiofdhoifdhoi dnidihdi nindiidid kamal3 from which build the issue is comming need to check it out .
      jbffbufb kamal4 from which build the issue is comming need to check it out .
      hfhfjfj kamal5 from whickamal from which build the issue is comming need to check it out .
      nidididn kamal6 from which build the issue is comming need to check it out .
      nnidnid kamal7 from which build the issue is comming need to check it out .

      1 Reply Last reply Reply Quote 0
      • kamal lochanK Offline
        kamal lochan
        last edited by

        another example:

        input text:

        kamal kamal kamal kamal

        kamal kamal kamal kamal

        output text:

        kamal 1 kamal 2 kamal 3 kamal 4

        kamal 5 kamal 6 kamal 7 kamal 8

        PeterJonesP 1 Reply Last reply Reply Quote 0
        • PeterJonesP Offline
          PeterJones @kamal lochan
          last edited by

          @kamal-lochan ,

          The Notepad++ search engine does not have a way to auto-increment a counter in the replacement string.

          There are two ways that I can think of to get around this:

          1. If you know the maximum number of instances you are going to hit, you could use a trick that @guy038 uses, which is to add a list of numbers at the end of the document after some sort of unique marker line (you can add the numbers easily using the Edit > Column Editor), then use a search-and-replace that grabs the first item from the after-marker list and appends it to the match. This post by @guy038 about merging two files might be a conceptual starting place for you.

          2. If you are willing to add a plugin like PythonScript, you can use the editor.research method to call a function which will increment the number. This post shows an example ripped from the PythonScript docs that adds one to each number found in the document; a slightly modified version could be used to add one to a global variable, and then use that global variable in the replacement for each match.

          Alan KilbornA PeterJonesP 2 Replies Last reply Reply Quote 0
          • Alan KilbornA Offline
            Alan Kilborn @PeterJones
            last edited by

            @PeterJones

            You’re probably about to find out that we have yet another user that likes to open multiple threads to ask the same question over and over; see HERE

            1 Reply Last reply Reply Quote 0
            • PeterJonesP Offline
              PeterJones @PeterJones
              last edited by

              warning to future readers

              @kamal-lochan asked the identical question in a separate topic, where the dicussion continued.

              please don’t do that

              @kamal-lochan , This is frustrating to people who want to help you. I hadn’t read to the repost of your question yet, so I spent 10 minutes coming up with a reply and posted that; it wasn’t until another member messaged me to inform me that the question was re-asked there (and then @Alan-Kilborn posted here to let me know as well) that I found out you’d asked your question twice – and that others had already answered you hours ago.

              1 Reply Last reply Reply Quote 0

              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