• Login
Community
  • Login

Search and replace not working properly ...

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
9 Posts 5 Posters 15.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.
  • H
    Hakim Oerton
    last edited by Feb 6, 2017, 2:37 AM

    I have for months been successfully transferring text from PDF documents to N++ and stripping the CR&LF that appears after each word by searching for \r\n and replacing with \s with the extended option ticked.
    Yesterday this stopped working. I deleted my install and downloaded the latest version to find the same problem which is that the CR&LF are replaced by a literal \s inserted before each word.
    Any idea of what is happening here?

    1 Reply Last reply Reply Quote 1
    • H
      Hakim Oerton
      last edited by Feb 6, 2017, 4:05 AM

      Debug info is here if it is useful:
      Notepad++ v7.3.1 (32-bit)
      Build time : Jan 17 2017 - 00:21:10
      Path : C:\Program Files (x86)\Notepad++\notepad++.exe
      Admin mode : ON
      Local Conf mode : OFF
      OS : Windows 7
      Plugins : mimeTools.dll NppConverter.dll NppExport.dll NppFTP.dll PluginManager.dll

      S 1 Reply Last reply Feb 6, 2017, 1:43 PM Reply Quote 1
      • S
        Scott Sumner @Hakim Oerton
        last edited by Feb 6, 2017, 1:43 PM

        @Hakim-Oerton

        I don’t know about the “Extended” Search Mode as I have no experience with it. I see little use for it since Regular Expression mode was added in version 6.0 – my guess is that extended mode is still retained for people that are accustomed to using it.

        Why don’t you try doing your Search-and-Replace this way?:

        Find what: \r\n
        Replace with: \x20
        Mode: Regular expression

        You could enter simply a single space into the “Replace with” box, but as that would be hard to show in red above, I opted for the hex version of a single space (the \x20). Either way will work.

        1 Reply Last reply Reply Quote 1
        • S
          Sanjay Jha
          last edited by Feb 7, 2017, 4:34 AM

          Normal text search not working for me too… Find next button doesn’t show anything, while “Find all in current document” shows the occurrences correctly.

          1 Reply Last reply Reply Quote 0
          • A
            AdrianHHH
            last edited by Feb 7, 2017, 8:52 AM

            Occasionally I leave the “In selection” tick box on the replace window ticked, then I get very confused about why a replace does not do what I want. Unticking the “In selection” box and shouting at my mouse for clicking the wrong things lets the replacement work OK.

            1 Reply Last reply Reply Quote 0
            • V
              Vasile Caraus
              last edited by Feb 7, 2017, 11:24 AM

              @Scott-Sumner said:

              \x20

              by the way, please tell me. x20 is the same thing as one space between words?

              S 1 Reply Last reply Feb 7, 2017, 12:31 PM Reply Quote 0
              • S
                Scott Sumner @Vasile Caraus
                last edited by Feb 7, 2017, 12:31 PM

                @Vasile-Caraus

                @Scott-Sumner said:

                You could enter simply a single space into the “Replace with” box, but as that would be hard to show in red above, I opted for the hex version of a single space (the \x20). Either way will work.

                Was that unclear? or just not read?

                1 Reply Last reply Reply Quote 0
                • V
                  Vasile Caraus
                  last edited by Feb 7, 2017, 2:50 PM

                  @Scott-Sumner said:

                  a single space into the “Re

                  hello. I read, only that I made a regex and \x20 was not working as a space.

                  S 1 Reply Last reply Feb 8, 2017, 12:43 PM Reply Quote 0
                  • S
                    Scott Sumner @Vasile Caraus
                    last edited by Feb 8, 2017, 12:43 PM

                    @Vasile-Caraus

                    Create a UTF-8 document with some “word” data in it. For example, copy-n-paste the content of this posting.

                    Get to the Find dialog’s Replace tab:

                    • Find what: \w
                    • Replace with: \x20
                    • Search mode: Regular expression
                    • Wrap around: checked
                    • Uncheck all other checkboxes on Replace tab.

                    Press the Replace button one or more times. Each press replaces a word character with a single space character.

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