Community
    • Login

    Write numbers from one to another one.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 5 Posters 4.8k 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.
    • dedsec24D
      dedsec24
      last edited by

      Hello
      I want to write for example from 1-1000 in notepad ++.
      Like this 1,2,3,4,5,6,…1000
      How can I do this?

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

        Select a number of (blank) lines equal to how high you want to count. Edit > Column Editor (Alt+C) > ☑ Number to Insert > Initial: #, Increase: 1, and it will start at #.

        If it’s okay to be on separate lines, you’re done.

        If you want them comma-separated instead, then select the rows, Search > Replace (Ctrl+R), FindWhat=\R, ReplaceWith=, (that’s comma space), ☑ In Selection, Replace All.

        dedsec24D 1 Reply Last reply Reply Quote 2
        • Scott SumnerS
          Scott Sumner
          last edited by

          @PeterJones said:

          If you want them comma-separated instead

          I would revise Peter’s Replace All action as follows:

          Find what zone: \x20*\R
          Search mode: Regular expression

          The reason for the tweak to the Find what is that this Column editor commnd will pad on the right with blank characters if you do more than 10 lines. The Search mode addition is simply because Peter forgot to mention it. :-)

          1 Reply Last reply Reply Quote 1
          • Gogo NeatzaG
            Gogo Neatza
            last edited by

            One short Python Script should do the job:
            s=‘’
            for i in range(1,1001):
            s += ‘{:},’.format(i)

            editor.appendText(s)

            inserting 1,2,3,4,5,6,…1000, at the current cursor position.

            Or with some help from mawk (3rd party free software and NppExec):
            mawk “BEGIN { for (i = 1; i <= 1000; i++) {if (i==1000) {printf i} else {printf i’,'}} }” | clip
            have 1,2,3,4,5,6,…1000 saved in the clipboard.

            1 Reply Last reply Reply Quote 1
            • dedsec24D
              dedsec24 @PeterJones
              last edited by

              @PeterJones
              Hello again
              Thanks Peter Jones
              It works
              But i have a question.
              Is there any way to make a lot of blank lines by the app not by hand?

              Scott SumnerS 1 Reply Last reply Reply Quote 0
              • Scott SumnerS
                Scott Sumner @dedsec24
                last edited by

                @dedsec24 said:

                make a lot of blank lines by the app not by hand?

                Yes, do the following:

                • Macro (menu) -> Start Recording
                • In a document tab, press the Enter key
                • Macro (menu) -> Stop Recording
                • Macro (menu) -> Run a Macro Multiple Times…
                1 Reply Last reply Reply Quote 0
                • guy038G
                  guy038
                  last edited by

                  Hello @dedsec24, @scott-sumner,

                  I don’t understand, exactly, the necessity to create a macro ?!

                  Why not, either :

                  • Hold down the Enter key, the necessary time ?

                  • Create a pure blank line and hit on the Ctrl + D shortcut, several times ?

                  Cheers,

                  guy038

                  Scott SumnerS 1 Reply Last reply Reply Quote 0
                  • Scott SumnerS
                    Scott Sumner @guy038
                    last edited by

                    @guy038

                    My assumption was that one knows how many blank lines one wants…a hard number. Then one puts this number into the Run a Macro Multiple Times… input box when prompted.

                    Of course, if one just wants a “gob” of blank lines, then sure, just hold down the Enter key…

                    We sure do get a lot of vague questions on here, though, don’t we? :-)

                    1 Reply Last reply Reply Quote 1
                    • dedsec24D
                      dedsec24
                      last edited by

                      Thanks all of you
                      I got my answer.

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