• Login
Community
  • Login

Counting up a number that is part of a line

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 2 Posters 573 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.
  • C
    Cirlot123456
    last edited by Jan 3, 2022, 10:18 AM

    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?

    E 1 Reply Last reply Jan 3, 2022, 11:10 AM Reply Quote 0
    • E
      Ekopalypse @Cirlot123456
      last edited by Ekopalypse Jan 3, 2022, 11:12 AM Jan 3, 2022, 11:10 AM

      @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.

      C 1 Reply Last reply Jan 3, 2022, 11:33 AM Reply Quote 3
      • C
        Cirlot123456 @Ekopalypse
        last edited by Cirlot123456 Jan 3, 2022, 11:36 AM Jan 3, 2022, 11:33 AM

        @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

        E 1 Reply Last reply Jan 3, 2022, 11:39 AM Reply Quote 0
        • E
          Ekopalypse @Cirlot123456
          last edited by Jan 3, 2022, 11:39 AM

          @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.

          C 1 Reply Last reply Jan 3, 2022, 11:42 AM Reply Quote 3
          • C
            Cirlot123456 @Ekopalypse
            last edited by Jan 3, 2022, 11:42 AM

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

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