• Login
Community
  • Login

replace function

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
49 Posts 9 Posters 52.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.
  • P
    Pouemes44
    last edited by May 16, 2017, 3:28 PM

    hello,
    i search the way to search something like

    jgjjkhhgyuu
    jiopuy

    ** and replace with**

    edfgg
    j,j;;èè–i56
    ghhghhykk
    ppppsfsdf

    so i search a way to replace in adding lines or in removing lines

    is it possibe with notepad++ or is there a plugin to do it?
    thanks

    C S 2 Replies Last reply May 16, 2017, 5:15 PM Reply Quote 0
    • C
      Claudia Frank @Pouemes44
      last edited by May 16, 2017, 5:15 PM

      @kat75

      sorry, but how should one know what you want with such kind of info??

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • S
        Scott Sumner @Pouemes44
        last edited by May 16, 2017, 5:23 PM

        @kat75

        Do a regular expression replace where you set the find-what box to jgjjkhhgyuu\r\njiopuy and the replace-with box to
        edfgg\r\nj,j;;èè–i56\r\nghhghhykk\r\nppppsfsdf ?? (assumes Windows line-endings)

        Maybe this is overly simplistic and doesn’t work for your situation; in that case, see @Claudia-Frank 's response.

        1 Reply Last reply Reply Quote 0
        • P
          Pouemes44
          last edited by May 17, 2017, 1:46 PM

          hello claudia
          thanks to have answered
          i would to be able to search multilines and replace multilines
          imagine a script in a html page
          so i would to be able to search then replace multi lines with space by others with spaces or delete etc
          perhaps what propose scott works.
          it will be fantastic if notepad++ could do it easily, perhaps a plugin

          S 1 Reply Last reply May 17, 2017, 1:49 PM Reply Quote 0
          • S
            Scott Sumner @Pouemes44
            last edited by May 17, 2017, 1:49 PM

            @kat75

            Maybe you are talking about something like what is discussed in this thread?: https://notepad-plus-plus.org/community/topic/13684/feature-request-textarea-search-replace

            1 Reply Last reply Reply Quote 0
            • P
              Pouemes44
              last edited by May 17, 2017, 5:06 PM

              hello scott
              yes, i think its what i was talking

              C 1 Reply Last reply May 17, 2017, 9:02 PM Reply Quote 0
              • C
                Claudia Frank @Pouemes44
                last edited by Claudia Frank May 17, 2017, 9:02 PM May 17, 2017, 9:02 PM

                @kat75

                Just to make it clear - you still can do this with notepad++
                although it isn’t that intuitive.

                what you need to do is

                select the text you want to be replaced and press ctrl+h

                select the text which should replace the original text and press ctrl+c
                click into the replace with field and press ctrl+v

                click into the doc where you want the text to be replaced (click above the text)
                press find next
                press replace

                Done

                Cheers
                Claudia

                1 Reply Last reply Reply Quote 0
                • P
                  Pouemes44
                  last edited by May 18, 2017, 11:46 AM

                  thanks claudia
                  not easy but yes works
                  it will be great if some one could make a plugin to simplify this
                  or perhaps a next update of notepad++

                  S 1 Reply Last reply May 18, 2017, 11:53 AM Reply Quote 0
                  • S
                    Scott Sumner @Pouemes44
                    last edited by May 18, 2017, 11:53 AM

                    @kat75, @Claudia-Frank :

                    Does this really work when there are multiple lines in the replace text? It doesn’t work for me; I find the behavior consistent with the discussion in this thread (https://notepad-plus-plus.org/community/topic/12973/multiple-line-replacing-doesn-t-work ) where it doesn’t work for the OP and @guy038 concurs…

                    C 1 Reply Last reply May 18, 2017, 1:54 PM Reply Quote 0
                    • C
                      Claudia Frank @Scott Sumner
                      last edited by May 18, 2017, 1:54 PM

                      @Scott-Sumner

                      yes, tested on 7.3.3 and 7.4 (both 32 bit).
                      Scott, I do not fake screenshots :-D

                      Cheers
                      Claudia

                      S 1 Reply Last reply May 18, 2017, 2:08 PM Reply Quote 1
                      • S
                        Scott Sumner @Claudia Frank
                        last edited by May 18, 2017, 2:08 PM

                        @Claudia-Frank

                        Ah, okay, this is good to know. You are way-more bleeding edge than I want to be, with the Notepad++ version you’re using. I try to not be too far behind, but reading about problems here (esp. recent 7.4 problems, for ex.) gives me strong hints about which version to (not) use.

                        I don’t see anywhere in recent “new features and bug-fixes” list where it mentions a change in this area. Nice.

                        It is good that it works as you describe now; takes care of the need of the OP in the thread I referenced earlier. And it is not overly burdensome to do (IMO), contrary to what @kat75 was saying.

                        C 1 Reply Last reply May 18, 2017, 2:22 PM Reply Quote 0
                        • C
                          Claudia Frank @Scott Sumner
                          last edited by May 18, 2017, 2:22 PM

                          @Scott-Sumner

                          a nice improvement would be, if you have a active selection and you click into
                          find what and/or replace with fields, it automatically replaces the previous used ones.

                          So this would simplify it to,

                          Select the text block
                          open replace dialog (find what: is filled automatically)
                          select the text block you want to be used as replacement
                          click into replace with field, which than is updated with the current selected text.

                          Cheers
                          Claudia

                          1 Reply Last reply Reply Quote 1
                          • I
                            Ion Saliu Banned
                            last edited by Ion Saliu May 18, 2017, 5:08 PM May 18, 2017, 5:06 PM

                            @Claudia Frank:

                            I admire your Notepad++ savvy. You might be a bit bossy (even condescending) at times, but that’s OK with me. After Donald Trump in the White House, just about everybody is a saint(ess)!

                            The OP wanted a search/replace (in opened files or on disk) as the ‘Replace Text” freebie by Ecobyte. I presented that very productive and convenient feature here:

                            https://notepad-plus-plus.org/community/topic/13808/search-replace-of-multiline-text-blocs

                            I thought Notepad++ would do that in the ‘Extended (\n, r, …)’ search option. It doesn’t — and we can only hope the feature will be added in a future release.

                            I tried your procedure. The ‘Find what’ worked, although I didn’t see any special character between the copied lines.

                            Unluckily, the ‘Replace with’ box only copied the first line of text. See screenshot. I use 32-bit Notepad++ v7.3.3.

                            Extended Search/Replace in Notepad++

                            Hope you have influence on the highly skilled creator of Notepad++.

                            Ion Saliu
                            “A good man is an axiomatic man; an axiomatic man is a happy man. Be axiomatic!”

                            S C 2 Replies Last reply May 18, 2017, 5:11 PM Reply Quote 0
                            • S
                              Scott Sumner @Ion Saliu
                              last edited by May 18, 2017, 5:11 PM

                              @Ion-Saliu

                              Yea, I just tried the same test with 7.4 and it didn’t do the multiline thing in the replace-with box, so now I’m starting to think that @Claudia-Frank IS faking screenshots.

                              :-D

                              C 1 Reply Last reply May 18, 2017, 10:08 PM Reply Quote 0
                              • C
                                Claudia Frank @Ion Saliu
                                last edited by May 18, 2017, 5:12 PM

                                @Ion-Saliu

                                You might be a bit bossy (even condescending) at times, but that’s OK with me. After Donald Trump in the White House, just about everybody is a saint(ess)!

                                Might I ask what you are referring to?

                                Cheers
                                Claudia

                                1 Reply Last reply Reply Quote 0
                                • J
                                  Jim Dailey
                                  last edited by Jim Dailey May 18, 2017, 6:46 PM May 18, 2017, 6:44 PM

                                  @Claudia-Frank

                                  You might be a bit bossy (even condescending) at times…

                                  Might I ask what you are referring to?

                                  I don’t read every posting, but I cannot imagine there is even one where you were even in the neighborhood of bossy or condescending.

                                  I’ve seen you reply admirably to posts that I wanted to respond to with some response along the lines of, “Come back when you have the faintest idea what you are doing”. The best I could do was resist the urge, but you put me to shame with your thoughtful, helpful answers. Keep up the tremendously good work!

                                  1 Reply Last reply Reply Quote 4
                                  • C
                                    Claudia Frank @Scott Sumner
                                    last edited by May 18, 2017, 10:08 PM

                                    @Scott-Sumner

                                    took some time to create the animated gif.

                                    Cheers
                                    Claudia

                                    1 Reply Last reply Reply Quote 0
                                    • I
                                      Ion Saliu Banned
                                      last edited by May 18, 2017, 11:46 PM

                                      @Claudia Frank:

                                      There is something strange about you, axiomatico. Methinks you cook the books. Or, perhaps your version of Notepad++ is special and not available to programmers like me.

                                      I did it again. Once again, the procedure didn’t work in my Notepad++ neck-of-the-woods. The replace box only copies the first line in the bloc. I used the ‘Edit’ menu and also the contextual menu (right-click). Look again at the screenshot:

                                      Extended Search/Replace in Notepad++ClaudiaCheat

                                      So, what you did: Cook the books. You created just one paragraph in a narrow screen with ‘Word-wrap on’. Why don’t you do on a page I know? Download this page from my website, open page source, copy-and-paste the content to a new Notepad++ file. Apply your procedure and show us a real screenshot.

                                      The page is a little more complicated as it has ‘pre’ sections that show different fonts.

                                      Statistical Page Pick-3 Lottery in Notepad++

                                      If not, you have a serious behavioral problem (@Scott Sumner nods approvingly). Notepad++ is not served by fabricating things.

                                      Ion Saliu
                                      “A good man is an axiomatic man; an axiomatic man is a happy man. Be axiomatic!”

                                      C 1 Reply Last reply May 19, 2017, 12:14 AM Reply Quote 0
                                      • C
                                        Claudia Frank @Ion Saliu
                                        last edited by May 19, 2017, 12:14 AM

                                        @Ion-Saliu

                                        Could it be that it is related to Unix? I’m running npp on ubuntu.
                                        Would you give it a try to convert eols to unix and redo the test?

                                        What about my question? Do you wanna answer it or do you prefer to keep insulting me?

                                        Cheers
                                        Claudia

                                        1 Reply Last reply Reply Quote 2
                                        • I
                                          Ion Saliu Banned
                                          last edited by May 19, 2017, 1:16 AM

                                          Axiomatic Ones:

                                          Maybe there is another scenario in play here. Maybe this multiline replace function WAS present in a previous version of Notepad++. Obviously, I didn’t check every version regarding this replace function. Was it really present in a previous versions? Was the function dropped consciously (e.g. for copyright reasons) or inadvertently?

                                          Methinks it might be an overlooked property setting. Visual Basic has a property setting for the textbox: ‘Multiline = True’. Look at that under the property sheet of ‘Replace textbox’.

                                          Now, this hyper active Claudia Frank maybe works with a previous version of Notepad++ that featured the multiline replace. She should have been honest and tell us what version of Notepad she used. She just posted that actually she works with a Linux version of Notepad++. Scott Sumner and I disclosed the versions we are using.

                                          I run 32-bit Notepad++ on 64-bit Windows 10.

                                          Now, I put the blame squarely on the author of this excellent editor. This replace thingy has been debated a lot — I mean, a lot. There are several threads with hundreds of posts in this very community. Why does the author hide in silence? He knows better than anybody else if the feature we are debating here IS PRESENT OR NOT IN NOTEPAD++. Just a few paragraphs will do. Posts by Claudia Frank won’t do. She is disingenuous. She cooks the books, even by Photoshopping…

                                          Ion Saliu
                                          “A good man is an axiomatic man; an axiomatic man is a happy man. Be axiomatic!”

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