• Login
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.
  • D
    dedsec24
    last edited by Mar 27, 2018, 2:54 PM

    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
    • P
      PeterJones
      last edited by Mar 27, 2018, 4:27 PM

      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.

      D 1 Reply Last reply Mar 31, 2018, 8:26 AM Reply Quote 2
      • S
        Scott Sumner
        last edited by Mar 27, 2018, 6:04 PM

        @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
        • G
          Gogo Neatza
          last edited by Mar 28, 2018, 9:27 AM

          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
          • D
            dedsec24 @PeterJones
            last edited by Mar 31, 2018, 8:26 AM

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

            S 1 Reply Last reply Mar 31, 2018, 12:48 PM Reply Quote 0
            • S
              Scott Sumner @dedsec24
              last edited by Mar 31, 2018, 12:48 PM

              @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
              • G
                guy038
                last edited by Mar 31, 2018, 2:56 PM

                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

                S 1 Reply Last reply Mar 31, 2018, 3:58 PM Reply Quote 0
                • S
                  Scott Sumner @guy038
                  last edited by Mar 31, 2018, 3:58 PM

                  @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
                  • D
                    dedsec24
                    last edited by Mar 31, 2018, 5:06 PM

                    Thanks all of you
                    I got my answer.

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