• Login
Community
  • Login

Line Number

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
9 Posts 4 Posters 3.5k 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.
  • M
    Mohamed Elgoussi
    last edited by Dec 21, 2017, 11:50 AM

    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.

    C 1 Reply Last reply Dec 21, 2017, 12:22 PM Reply Quote 0
    • C
      Claudia Frank @Mohamed Elgoussi
      last edited by Dec 21, 2017, 12:22 PM

      @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
      • M
        Mohamed Elgoussi
        last edited by Dec 23, 2017, 6:22 AM

        @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

        C 1 Reply Last reply Dec 23, 2017, 12:35 PM Reply Quote 0
        • C
          Claudia Frank @Mohamed Elgoussi
          last edited by Dec 23, 2017, 12:35 PM

          @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
          • G
            guy038
            last edited by guy038 Dec 23, 2017, 2:11 PM Dec 23, 2017, 2:07 PM

            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
            • M
              Mohamed Elgoussi
              last edited by Dec 25, 2017, 7:22 AM

              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
              • G
                guy038
                last edited by guy038 Dec 25, 2017, 10:06 AM Dec 25, 2017, 10:06 AM

                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
                • M
                  Mohamed Elgoussi
                  last edited by Dec 26, 2017, 3:19 PM

                  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
                  • G
                    gstavi
                    last edited by Dec 26, 2017, 3:32 PM

                    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
                    6 out of 9
                    • First post
                      6/9
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors