Community
    • Login

    Counting up a number that is part of a line

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 1.0k 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.
    • Cirlot123456C Offline
      Cirlot123456
      last edited by

      Here is what I want to do:
      I have this line

      af_100000_lead_box = 0.000001

      and I want this line replicated except that the 100000 keeps counting up 3332 times

      af_100001_lead_box = 0.000001
      af_100002_lead_box = 0.000001

      until

      af_103332_lead_box = 0.000001

      Can someone help me with this?

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE Offline
        Ekopalypse @Cirlot123456
        last edited by Ekopalypse

        @cirlot123456

        Duplicate the row as often as you like and use the “column editor” to replace the 0000 with increasing values.

        The easiest way is to record a macro for a duplication and play it back as many times as necessary,
        Then put the caret in the first line before the 4th 0 from the right, for example
        af_10|0000_lead_box = 0.000001 ( | should be the caret ) and
        scroll to the last line, hold shift+alt and click on the last 0, which should look something like this.

        f7913de0-a90b-4793-9855-4afc947a7359-image.png

        Call ColumnEditor and let the values change.

        8049fccc-0201-483b-962e-df88fb3908c8-image.png

        It is IMPORTANT that you only select as many places as you actually want to replace.

        The example only selects two because I only replace two digits, otherwise the rest of the zeros would be cut off. Play with it and you will see what I mean.

        Cirlot123456C 1 Reply Last reply Reply Quote 3
        • Cirlot123456C Offline
          Cirlot123456 @Ekopalypse
          last edited by Cirlot123456

          @ekopalypse Thank you. Macro worked great, but I can´t get the step with the caret to work. This is what I get when I shift+alt:

          https://imgur.com/a/n1Vek0Z

          What am I doing wrong?

          EDIT: Maybe a version difference, I can mark the 00 with my mouse and then click alt+shift on the last line I want it applied to, that works fine then

          EkopalypseE 1 Reply Last reply Reply Quote 0
          • EkopalypseE Offline
            Ekopalypse @Cirlot123456
            last edited by

            @cirlot123456

            It looks like you held down the shift key while selecting, if that is the case, no,

            • click on the start position and release all keys
            • scroll down to the last line and then press Shift+Alt and click the mouse on the last position to be selected.

            Btw … there is no need to use services like imgur anymore, you can just paste the image from clipboard into the post.

            Cirlot123456C 1 Reply Last reply Reply Quote 3
            • Cirlot123456C Offline
              Cirlot123456 @Ekopalypse
              last edited by

              @ekopalypse thanks I worked it out now, this is gonna be immensely useful in the future :)

              1 Reply Last reply Reply Quote 1

              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