replace function



  • 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



  • @kat75

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

    Cheers
    Claudia



  • @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.



  • 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



  • @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



  • hello scott
    yes, i think its what i was talking



  • @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



  • 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++



  • @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…



  • @Scott-Sumner

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

    Cheers
    Claudia



  • @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.



  • @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


  • Banned

    @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!”



  • @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



  • @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



  • @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!



  • @Scott-Sumner

    took some time to create the animated gif.

    Cheers
    Claudia


  • Banned

    @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!”



  • @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


  • Banned

    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!”


Log in to reply