• Login
Community
  • Login

Multiple search terms replaced with multiple terms

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
17 Posts 4 Posters 6.7k 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.
  • A
    Alan Preda
    last edited by Dec 16, 2016, 1:42 PM

    Thanks again Claudia! It seems that you posted the same capture for both After and Before. Anyway, checking the Match case box (which I did not before), changes the results of the Replace All, like this:

    A?teaptA, lasA-mA sA chem întAriri!

    It should be like this:

    Așteaptă, lasă-mă să chem întăriri!

    I think the ? in A?teaptA means the ș Unicode character is unknown to NPP, while ã is replaced with A instead of ă.

    link text

    S 1 Reply Last reply Dec 16, 2016, 1:49 PM Reply Quote 1
    • S
      Scott Sumner @Alan Preda
      last edited by Dec 16, 2016, 1:49 PM

      @Alan-Preda said:

      It seems that you posted the same capture for both After and Before

      No, clearly the images are different. Please examine things carefully before replying.

      Also, “my computer yells at me” isn’t the type of error report that most people will even consider replying to. @Claudia-Frank, however, is saintly, and will most always try to reply with some help… :-)

      C 1 Reply Last reply Dec 16, 2016, 10:25 PM Reply Quote 0
      • A
        Alan Preda
        last edited by Dec 16, 2016, 2:20 PM

        Again thank you for responding! I’ve figured it out.

        Your suggestion to remove the pipes in the Replace With field was good. By itself it did not work. First convert the ANSI file to UTF-8, then apply the RegEx Replace without pipes in the Replace field, making sure the Match Case box is checked, was what made it work. Thank you anyway. Your suggestion helped.

        My eyes may not be as good as yours. I looked as both Before and After captures with the Windows Magnifier at 300%. I could not find any difference. I’m posting below a link to a screen capture of your post. Can you please help me discover the differences between the two pictures, by highlighting them in red?

        link text

        Thank you much!

        1 Reply Last reply Reply Quote 0
        • A
          Alan Preda
          last edited by Dec 16, 2016, 2:33 PM

          @Scott-Summer

          “My computer yells at me” meant it emitted the error Windows sound. It did not cross my mind it will be so difficult to translate that into IT language (I am IT). My appologies!

          S 1 Reply Last reply Dec 16, 2016, 3:34 PM Reply Quote 0
          • S
            Scott Sumner @Alan Preda
            last edited by Dec 16, 2016, 3:34 PM

            @Alan-Preda

            No problem. Maybe it is me, but it absolutely didn’t cross my mind to equate “yells at me” to the “system error bell”. I use my PC with sound muted; maybe that’s why…

            1 Reply Last reply Reply Quote 0
            • A
              Alan Preda
              last edited by Dec 16, 2016, 8:34 PM

              @Claudia Frank
              I realized why it worked for you by only removing the pipes in the Remove field, but it did not for me. You copied my example (Aºteaptã, lasã-mã să chem întãriri!) and pasted it into a new NPP document. By default, NPP is setup to make any new document into a UTF-8 document (to include correct representation of all characters, in all languages). In my case, as mentioned in my first message, I opened an ANSI file in NPP and applied the RegEx Replace strings to it. My file was an existing document, not a new document, so NPP did not automatically change it to UTF-8. I had to convert it first, from the Encoding menu, and then it worked. As I said, your original suggestion did help though, so I am grateful.

              @Scott Sumner said:
              “No, clearly the images are different. Please examine things carefully before replying.”

              I’ve also realized the phrase quoted above came from you, not Claudia. I’m still unable to find the differences between the Before and After pictures. I’ve posted a link to a screen capture of Claudia’s post with the two images. Maybe YOU can help me find what’s different between them, by highlighting it in red. Thank you in advance.

              C 1 Reply Last reply Dec 16, 2016, 10:20 PM Reply Quote 0
              • G
                guy038
                last edited by guy038 Dec 16, 2016, 9:37 PM Dec 16, 2016, 9:36 PM

                Hello, Alan,

                Indeed, the two Claudia’s pictures are different ! Just look, carefully, the line 3, six characters have changed, in the sentence, accordingly to your regex search/replacement :-))

                In the line 3, of the pictures, as expected :

                • Character º is changed into the character ș, at position 2

                • Character ã is changed into the character ă , at positions 8, 14, 17, 20 and 30

                Best regards,

                guy038

                1 Reply Last reply Reply Quote 0
                • C
                  Claudia Frank @Alan Preda
                  last edited by Claudia Frank Dec 16, 2016, 10:22 PM Dec 16, 2016, 10:20 PM

                  @Alan-Preda

                  sorry for being late, answered the question just before I went to work.
                  As Scott and guy038 already said, the images are different.
                  In regards to the problem you discovered, of course, it must be made sure that
                  text which needs to be converted are in the expected format. As I was copying from html page
                  it most likely was encoded in utf-8.
                  But if you have a valid ANSI text and the replace chars are as well ANSI compatible, it should have been worked.

                  Cheers
                  Claudia

                  1 Reply Last reply Reply Quote 0
                  • A
                    Alan Preda
                    last edited by Dec 16, 2016, 10:22 PM

                    Wow! Thank you guy038!!!
                    I was looking for changes in the Replace strings, while Claudia was pointing to the changes MADE by applying the RegEx Replace function (at the top of the image). That is, I was thinking Claudia posted the before and after to show me how to correct my replace strings, while she actually posted them to show me the Replace string without pipes does work!

                    Many thanks again to both of you! You two guys are making a great support team on this forum!

                    C 1 Reply Last reply Dec 16, 2016, 10:29 PM Reply Quote 0
                    • C
                      Claudia Frank @Scott Sumner
                      last edited by Dec 16, 2016, 10:25 PM

                      @Scott-Sumner

                      Hi Scott,

                      thx for the kind words or … ?? ;-)
                      I’ve asked leo.org what saintly means and it tells me that
                      I’m either holy Mary or behave like a sheep. :-D

                      I take the sheep if you don’t mind!

                      Cheers
                      Claudia

                      1 Reply Last reply Reply Quote 1
                      • C
                        Claudia Frank @Alan Preda
                        last edited by Dec 16, 2016, 10:29 PM

                        @Alan-Preda

                        Many thanks again to both of you! You two guys are making a great support team on this forum!

                        If I would have the same patience that guy038 has, I would have written a book ;-)
                        about what I’ve done but as I’m lazy and just found out that my linux screenshot tool
                        can upload images automatically I prefer this way because a picture says more the words.
                        Well, mostly ;-)

                        Cheers
                        Claudia

                        1 Reply Last reply Reply Quote 0
                        • A
                          Alan Preda
                          last edited by Dec 16, 2016, 11:55 PM

                          @Claudia Frank
                          Thank you Claudia for the added details to your initial answer. As I mentioned, you copying my example from the html page and pasting it into a new document in NPP made it work for you. Because of this default setting, shown in the capture found following the link below:

                          link text

                          Many thanks, again and again! :)

                          C 1 Reply Last reply Dec 17, 2016, 12:08 AM Reply Quote 0
                          • C
                            Claudia Frank @Alan Preda
                            last edited by Dec 17, 2016, 12:08 AM

                            @Alan-Preda

                            Alan, your welcome.
                            You are right, this setting is set because I only work with utf-8 at all.
                            Just to be sure, your question has been answered or is there something left?

                            Cheers
                            Claudia

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