Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Delete Chinese text after comparing two XML documents

    Help wanted · · · – – – · · ·
    3
    31
    3742
    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.
    • andrecool-68
      andrecool-68 @guy038 last edited by

      @guy038

      You’ll laugh but it worked for this piece of code and left the rest unchanged.

      1 Reply Last reply Reply Quote 1
      • Meta Chuh
        Meta Chuh @guy038 last edited by

        @guy038

        that’s why you are the guru ;-)

        it is always astonishing how many things you are capable of thinking ahead so quickly.
        like a game of chess, where you know the outcome of the game, even before a user makes the first draw.

        this example looked so easy to me at first, but i have missed to think about so many things in advance, and this clearly shows the limits of my “trial and error” attempts.

        ps: i thought you were skiing today … or are you writing from your mobile phone, while you are actually cruising down the slopes at the same time ? 😉👍

        andrecool-68 1 Reply Last reply Reply Quote 2
        • andrecool-68
          andrecool-68 @Meta Chuh last edited by

          @Meta-Chuh

          We have in Israel, plus 22 degrees Celsius , and it is very difficult in this weather to ski)))

          Meta Chuh 1 Reply Last reply Reply Quote 2
          • andrecool-68
            andrecool-68 last edited by

            Thank you all very much for your help!

            1 Reply Last reply Reply Quote 2
            • Meta Chuh
              Meta Chuh @andrecool-68 last edited by

              @andrecool-68

              We have in Israel, plus 22 degrees Celsius , and it is very difficult in this weather to ski)))

              😂 i would like to have your temperatures and climate around here too, plus a cocktail on a beach, with chillout music and happy people all around 👍

              1 Reply Last reply Reply Quote 2
              • guy038
                guy038 last edited by guy038

                Hi, @meta-chuh,

                Please, not a “regex guru”. Only a guy who always keeps his eyes amazed at the important text changes that these little pieces of code can produce !


                Sorry, Chuh, I did not write on my mobile phone while skiing ! Unlike young people, I still need a screen, with a fairly size to feel comfortable, while writing a post on our forum ;-))

                Actually, though weather was marvelous, and probably due to my recent indisposition, I was a bit tired last afternoon and I just stopped, up there, with a colleague, … … … for a beer, looking at the nice panorama around ! But, we’ve planned an other ski-day, next Thursday, on the “Les Menuires - St Martin de Belleville” ski area !

                Here is my modified “slopes map” picture, which shows the “Meribel - Les Menuires - Val Thorens” areas and part of Courchevel, on the left !

                img

                BR

                guy038

                1 Reply Last reply Reply Quote 4
                • andrecool-68
                  andrecool-68 last edited by

                  I did all these operations in a row, there are only 5 lines that can be cleared manually. I made a macro of these regular expressions, everything turned out well!

                  "e name="(.*?)[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}](.*?)\|
                  "e name="

                  " name="(.*?)[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}](.*?)\|
                  " name="

                  name="(.*?)[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}](.*?)\|
                  name="

                  " name="(.*?)[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}](.*?)\|
                  " name="

                  title="(.*?)[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}](.*?)\|
                  title="

                  message="(.*?)[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}](.*?)\|
                  message="

                  value="(.*?)[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}](.*?)\|
                  value="

                  Thank you very much for your efforts!

                  1 Reply Last reply Reply Quote 2
                  • andrecool-68
                    andrecool-68 last edited by

                    Here one regular expression is mistakenly duplicated. But in the macro everything is correct.
                    " name="(.*?)[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}](.*?)\|
                    " name="

                    1 Reply Last reply Reply Quote 1
                    • andrecool-68
                      andrecool-68 last edited by

                      Need to test such option, and compare their work.
                      (?-s)\x20(value|name|title|message)="\K.*?[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}].*?\|

                      1 Reply Last reply Reply Quote 3
                      • guy038
                        guy038 last edited by guy038

                        Hi, @andrecool-68,

                        I read your last posts with the different regeges and was about to suggest you such a regex, which combines all cases :-))

                        An other syntax, which allows, the step by step replacement, with several clicks on the Replace button, would be :

                        SEARCH (\x20(value|name|title|message)=").*?[\x{3000}-\x{303F}\x{4E00}-\x{9FEF}].*?\|

                        REPLACE \1

                        Cheers,

                        guy038

                        P.S. :

                        BTW, don’t you have some ski resorts, in Israel ? I’m thinking of the Mount Hermon Ski Resort !

                        andrecool-68 Meta Chuh 2 Replies Last reply Reply Quote 2
                        • andrecool-68
                          andrecool-68 @guy038 last edited by

                          @guy038
                          Small mountains we have in Israel but there is snow is very rare, and my friend flies every year to ski in Italy. And for me the best rest is fishing with a fishing rod.

                          Meta Chuh 1 Reply Last reply Reply Quote 2
                          • Meta Chuh
                            Meta Chuh @guy038 last edited by Meta Chuh

                            @guy038

                            Here is my modified “slopes map” picture, which shows the “Meribel - Les Menuires - Val Thorens” areas and part of Courchevel, on the left !

                            this is beautiful 😃.
                            next winter, as soon as my youngest son is old enough to have sufficient body control to enjoy it, i have to go skiing again, after a 3 year abstinence (far too long).

                            thanks for sharing.
                            short notices like that make this place pleasantly human to me, with a familiar atmosphere i enjoy. 👍

                            ps:

                            Please, not a “regex guru”

                            may i use “regex master”, or “sensei regex san”, or “darth regex” instead ? ;-)

                            1 Reply Last reply Reply Quote 1
                            • Meta Chuh
                              Meta Chuh @andrecool-68 last edited by Meta Chuh

                              @andrecool-68

                              this lake is very, very beautiful as well, i want to go there too.

                              … hmmmh … judging my reactions to the pictures from both of you, i guess that i urgently need a vacation 😂

                              andrecool-68 1 Reply Last reply Reply Quote 1
                              • andrecool-68
                                andrecool-68 @Meta Chuh last edited by

                                @Meta-Chuh
                                I do not go far to rest, health problems, and 40 kilometers to the lake I can do. When I was healthy and strong …long thought took a plane ticket and flew!

                                Meta Chuh 1 Reply Last reply Reply Quote 1
                                • Meta Chuh
                                  Meta Chuh @andrecool-68 last edited by

                                  @andrecool-68

                                  yes, unfortunately we don’t get any younger … but i always try to think that away ;-)
                                  i hope you get as strong as possible again, or at least stay stable in health 🙏

                                  andrecool-68 1 Reply Last reply Reply Quote 1
                                  • andrecool-68
                                    andrecool-68 @Meta Chuh last edited by

                                    @Meta-Chuh
                                    do not think that time will go back…live now!

                                    1 Reply Last reply Reply Quote 1
                                    • andrecool-68
                                      andrecool-68 last edited by

                                      xmlTreeNav translated into Russian language, it became much easier, was there a way to disable the duplication of the two language files. And delete the Chinese no longer need, leaving only the Chinese strings which do not exist in Russian localization. and five kinds of rows to delete.

                                      diff:status="modified"
                                      diff:status="removed"
                                      diff:status="below"
                                      diff:status="added"
                                      xmlns:diff="http://www.via.ecp.fr/~remi/soft/xml/xmldiff"

                                      Made a change from the previous regular expression.

                                      (\x20(diff:status|xmlns:diff)=").*?"

                                      1 Reply Last reply Reply Quote 1
                                      • First post
                                        Last post
                                      Copyright © 2014 NodeBB Forums | Contributors