Community
    • Login

    Line Number

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 4 Posters 4.1k Views 2 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.
    • Mohamed ElgoussiM Offline
      Mohamed Elgoussi
      last edited by

      I downloaded the following file
      http://www.gutenberg.org/files/2701/2701-0.txt

      If I search for “CHAPTER 1. Loomings.”
      using notepad in windows, it is found in line 850.
      using notepad++, it is found in line 1699.
      Why there is a difference in line number?
      Thanks.

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Mohamed Elgoussi
        last edited by

        @Mohamed-Elgoussi said:

        “CHAPTER 1. Loomings.”

        well I find it twice, line 48 and line 850.

        What is the last line number in your document?

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 1
        • Mohamed ElgoussiM Offline
          Mohamed Elgoussi
          last edited by

          @Claudia-Frank said:

          I am talking about line 850.
          If I view the file via notepad in windows, it is found in line 850, while last line is 22335
          If I view the file via notepad++, it is found in line 1699, while last line is 44669

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC Offline
            Claudia Frank @Mohamed Elgoussi
            last edited by

            @Mohamed-Elgoussi

            I would assume that the document was pasted twice in notepad++ and the cursor
            is placed after line 850 (or at least after the word loomings) when doing the search.
            Make sure that the cursor is on line 1 by clicking into it before searching for the word.
            As said, it is working for me.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 1
            • guy038G Offline
              guy038
              last edited by guy038

              Hello, @mohamed-elgoussi,

              If I view the file via notepad in windows, it is found in line 850, while last line is 22335
              If I view the file via notepad++, it is found in line 1699, while last line is 44669

              It’s easy to notice that 44669 = 22335 + 22334 and that 1699 = 850 + 849

              So, I suppose that, when you pasted the contents of your 2701-0.txt file, you probably did it twice !!

              With my N++ v7.5.1 version, I do obtain 2 occurrences of the CHAPTER 1. Loomings. string, at column 1 of the two lines 48 and 850, with the options Normal search and Wrap around :-)


              For information, your UTF-8 file contains 22,334 lines, of 71 characters max, for a total of 1,276,200 bytes

              This total can be broken down into :

                       1,208,075 characters, coded in 1 byte   =>  1,208,075 bytes
                              48 characters, coded in 2 bytes  =>         96 bytes
                           7,787 characters, coded in 3 bytes  =>     23,361 bytes
                      ----------                                   ---------
              CHARS    1,215,910 characters                        1,231,532 bytes
              		 
                          22,334 characters Carriage Return (CR)      22,334 bytes
                          22,334 characters Line Feed       (LF)      22,334 bytes
                      ----------                                   ---------
              TOTAL    1,260,578 characters                        1,276,200 bytes                     
              

              Best Regards,

              guy038

              1 Reply Last reply Reply Quote 0
              • Mohamed ElgoussiM Offline
                Mohamed Elgoussi
                last edited by

                Dear Sir,
                I have not pasted any thing twice.
                in R I run the following:
                download.file(“http://www.gutenberg.org/files/2701/2701-0.txt”, “xx.txt”) in R
                scan(“xx.txt”, what = “”, skip = 849, nlines = 1)
                [1] “CHAPTER” “1.” “Loomings.”
                i.e. which means that CHAPTER 1. Loomings. exists in line 850 not 1699 (as it is shown in file via notepad+).
                Thanks

                1 Reply Last reply Reply Quote 0
                • guy038G Offline
                  guy038
                  last edited by guy038

                  Hello, @mohamed-elgoussi,

                  I don’t understand ! Downloading from your second post, the contents, I obtain exactly the same file as before !

                  You say :

                  which means that CHAPTER 1. Loomings. exists in line 850 not 1699 (as it is shown in file via notepad+)

                  I’m sorry to insist, but, in my Notepad++ v7.5.1, I do have an occurrence of CHAPTER 1. Loomings., in line 850, and nothing, in line 1699 !

                  BTW the line 1699 is a pure blank line, surrounded by the text, as below :

                  his teeth, sprang into bed with me. I sang out, I could not help it
                  now; and giving a sudden grunt of astonishment he began feeling me.
                  
                  Stammering out something, I knew not what, I rolled away from him
                  against the wall, and then conjured him, whoever or whatever he might
                  

                  I don’t see. Hope that someone else will understand your problem !

                  Cheers,

                  guy038

                  1 Reply Last reply Reply Quote 0
                  • Mohamed ElgoussiM Offline
                    Mohamed Elgoussi
                    last edited by

                    Would you please take a look

                    https://drive.google.com/file/d/0B3Z74IvmfSYQbWZ0VVM1MWhfZ1dCeGtqSzd1UkFHNlAyQ3Rv/view?usp=sharing

                    https://drive.google.com/file/d/0B3Z74IvmfSYQTWhzWENiZU83R2lfSmY4bTFuZzRmOTBDUkNR/view?usp=sharing

                    1 Reply Last reply Reply Quote 0
                    • gstaviG Offline
                      gstavi
                      last edited by

                      The end of line is screwed, probably something like <CR><LF><LF>, Notepad++ sees every line as a line + blank line.
                      So Line number in Notepad++ is multiplied by 2.

                      1 Reply Last reply Reply Quote 3

                      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