• Login
Community
  • Login

Open text file and jump to the end

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
10 Posts 4 Posters 2.2k 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.
  • R
    Rahan Bölzer
    last edited by Oct 1, 2020, 12:41 PM

    Hey Guys, can i open a text file like a log File and jump automaticly to the end of the file?
    Maybe with a aditional parameter. Or with nen start macro.
    I know i can press Strg+End, but other people dont know this.

    P A M 3 Replies Last reply Oct 1, 2020, 1:16 PM Reply Quote 0
    • P
      PeterJones @Rahan Bölzer
      last edited by PeterJones Oct 1, 2020, 1:19 PM Oct 1, 2020, 1:16 PM

      @Rahan-Bölzer ,

      That feature is not built into Notepad++ as far as I am aware.

      To get an “[on] start macro”, you could use a plugin like PythonScript, and add editor.documentEnd() to startup.py, with the PythonScript > Configuration setting Initialisation: ATSTARTUP

      <edit>: That will only get it in the first active window. If you also want it every time you load a new file, you’d also have to define a callback for NOTIFICATION.FILEOPENED (there are some examples of callbacks in the PythonScript docs after you install the plugin)</edit>

      1 Reply Last reply Reply Quote 1
      • A
        Alan Kilborn @Rahan Bölzer
        last edited by Alan Kilborn Oct 1, 2020, 1:41 PM Oct 1, 2020, 1:41 PM

        @Rahan-Bölzer said in Open text file and jump to the end:

        I know i can press Strg+End, but other people dont know this.

        I think you mean Shift+End , but it could be that “Strg” is a non-English keyboard thing that I’ve never heard of.

        Anyway, Shift+End is a keycombo that works in most Windows programs – wouldn’t it be a good idea to educate other people about how things work?
        That seems to me like the best solution.

        P 2 Replies Last reply Oct 1, 2020, 1:45 PM Reply Quote 2
        • P
          PeterJones @Alan Kilborn
          last edited by PeterJones Oct 1, 2020, 1:45 PM Oct 1, 2020, 1:45 PM

          @Alan-Kilborn said in Open text file and jump to the end:

          I think you mean Shift+End

          I think you mean Ctrl+End. By default, Shift+End selects to the end of the line. By default, Ctrl+End moves the cursor to the end of the document

          60289620-f782-40f8-a251-1aef599fe21e-image.png

          A 1 Reply Last reply Oct 1, 2020, 1:48 PM Reply Quote 1
          • A
            Alan Kilborn @PeterJones
            last edited by Alan Kilborn Oct 1, 2020, 1:49 PM Oct 1, 2020, 1:48 PM

            @PeterJones said in Open text file and jump to the end:

            I think you mean Ctrl+End

            Yep, oops.

            That shows how little I think about it – I just DO IT!
            If you learn it and train yourself in its use early on, it becomes second-nature muscle-memory.
            One more argument for educating the masses.

            (I think I was thrown in what I was typing by OP’s use of “Strg” which made me think of “Shift”).

            Regardless, where I said Shift in my previous post, replace with Ctrl !
            Sorry.

            1 Reply Last reply Reply Quote 2
            • P
              PeterJones @Alan Kilborn
              last edited by Oct 1, 2020, 1:49 PM

              @Alan-Kilborn said in Open text file and jump to the end:

              it could be that “Strg” is a non-English keyboard

              Specifically, according to a quick search, Wiki says it’s German keyboards , being the abbreviation for “Steuerung ”.

              A 1 Reply Last reply Oct 1, 2020, 1:51 PM Reply Quote 1
              • A
                Alan Kilborn @PeterJones
                last edited by Oct 1, 2020, 1:51 PM

                @PeterJones said in Open text file and jump to the end:

                Wiki says it’s…

                The key part of that:

                …(thus e.g. “Ctrl” is translated to its German equivalent “Strg”, for Steuerung).

                1 Reply Last reply Reply Quote 0
                • M
                  Michael Vincent @Rahan Bölzer
                  last edited by Michael Vincent Oct 1, 2020, 1:55 PM Oct 1, 2020, 1:55 PM

                  @Rahan-Bölzer said in Open text file and jump to the end:

                  and jump automaticly to the end of the file

                  It’s a bit “hacky”, but could you just use the -n command line argument and put in a ridiculously large number (i.e., greater than the number of lines in your file)?

                  For me, opening a 2827 line file with:

                  notepad++.exe -n1000000000 file.txt
                  

                  puts the cursor on the last line of that file.

                  Note: Windows 10 64-bit, Notepad++ 7.9 64-bit

                  Cheers.

                  A 1 Reply Last reply Oct 1, 2020, 2:02 PM Reply Quote 6
                  • A
                    Alan Kilborn @Michael Vincent
                    last edited by Oct 1, 2020, 2:02 PM

                    @Michael-Vincent said in Open text file and jump to the end:

                    It’s a bit “hacky”, but could you just use the -n command line argument

                    I 💙 this solution.
                    I don’t see it as “hacky”.
                    Well…
                    I don’t see it that way because we’re all about “hacks” here. :-)

                    M 1 Reply Last reply Oct 1, 2020, 2:23 PM Reply Quote 3
                    • M
                      Michael Vincent @Alan Kilborn
                      last edited by Oct 1, 2020, 2:23 PM

                      @Alan-Kilborn said in Open text file and jump to the end:

                      I don’t see it as “hacky”.

                      I was hoping -1 (negative one) would be like “last array element” and bring me to the last line, but it didn’t work. I would think that would be “less hacky”.

                      :-)

                      Cheers.

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