Community
    • Login

    Replace Lines from different files

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    33 Posts 7 Posters 4.5k 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.
    • Ted PlumT
      Ted Plum @Alan Kilborn
      last edited by

      @Alan-Kilborn, thanks.

      1 Reply Last reply Reply Quote 0
      • Ted PlumT
        Ted Plum @Michael Vincent
        last edited by Ted Plum

        @Michael-Vincent @Mark-Olson, never mind my two previous comments. I’ve managed to run Mark’s script, and here’s the result :)

        https://drive.google.com/file/d/1b1yjTI027hss6ue-wJw6FnqyuRsecUiQ/view?usp=sharing

        Mark OlsonM Michael VincentM 2 Replies Last reply Reply Quote 1
        • Mark OlsonM
          Mark Olson @Ted Plum
          last edited by Mark Olson

          @Ted-Plum
          Glad you got it working!

          One final meta-suggestion: if you have a JSON plugin and the ComparePlus plugin installed, you can easily compare two JSON files.
          First, you want to pretty-print both JSON files (so that the same formatting rules are applied to both) and then you want to use ComparePlus to compare them.

          I do this all the time, and it works quite well.

          Alternatively

          x = json.loads(json_string_1)
          y = json.loads(json_string_2)
          assert x == y
          

          will check if json_string_1 and json_string_2 are equivalent JSON.

          1 Reply Last reply Reply Quote 1
          • Michael VincentM
            Michael Vincent @Ted Plum
            last edited by

            @Ted-Plum said in Replace Lines from different files:

            your script

            Just for clarification, it is @Mark-Olson 's script - I just use PythonScript a lot and an error:

            No module named ‘Npp’

            Implies a PythonScript is not being run from the PythonScript plugin or the plugin is not installed correctly.

            Glad it worked out though!

            Cheers.

            Ted PlumT 1 Reply Last reply Reply Quote 1
            • Ted PlumT
              Ted Plum @Michael Vincent
              last edited by

              @Michael-Vincent Yeah, I’ve corrected my reply. My issue with the plugin was that I hadn’t been able to put Mark’s script into the User Scripts menu. I eventually just added it to the Machine Scripts, ran it, and it seems to have worked.

              @Mark-Olson, will try all that. I’ve just been looking for a way to compare files in NPP too, thanks.

              PeterJonesP 1 Reply Last reply Reply Quote 0
              • PeterJonesP
                PeterJones @Ted Plum
                last edited by

                @Ted-Plum said in Replace Lines from different files:

                My issue with the plugin was that I hadn’t been able to put Mark’s script into the User Scripts menu

                Assuming a normal installation, which uses the %AppData%🛈 hierarchy for Notepad++ plugin settings, your user scripts need to be saved in the folder %AppData%\Notepad++\Plugins\Config\PythonScript\scripts

                This is described in Plugins > PythonScript > Context-Help in the “Plugin Installation and Usage” page. It’s also described in the footnotes section of the FAQ that Alan already directed you to.

                Ted PlumT 1 Reply Last reply Reply Quote 3
                • Ted PlumT
                  Ted Plum @PeterJones
                  last edited by Ted Plum

                  @PeterJones Ah, the AppData. I confused that with the Config folder in the installation folder for the NPP. It’s working now :)

                  1 Reply Last reply Reply Quote 0
                  • guy038G
                    guy038
                    last edited by guy038

                    Hi, @ted-plum, @mark-olson, @michael-vincent, @alan-kilborn, @peterjones and All,

                    At last, here is my regexes’s solution !


                    First, for a reason that I did not understand totally, the encoding of the !item-names.json file must not be changed to UTF-8. Indeed :

                    • Open the initial UTF-8-BOM file !item-names.json in N++

                    • Change its encoding with the Encoding > Convert to UTF-8 option and save it

                    • Close the !item-names.json file

                    • Re-open the !item-names.json file in N++ => On the status bar, the encoding is changed to ANSI and values in the file are modified ?!

                    Thus, I decided to, temporarily, normalize these two files to the UTF-8-BOM encoding, with Windows line-break ( \r\n )


                    In these two files, I deleted the outer square brackets

                    • Then, I ran the following regex S/R, onto these two files :

                      • SEARCH (?<!\},)(?<!\n)\r\n

                      • REPLACE \t

                    In order to get a single JSON record per line. So, it remains :

                    • 1,589 lines in the item-names.json file

                    • 1,536 lines in the !item-names.json file


                    Then, I created a new UTF-8-BOM file All.json where I pasted, first, the contents of the item-names.json file, then the contents of the !item-names.json file, giving a file of 3,125 lines

                    In a quick glance, I noticed 3 lines were not aligned with all the others ( easy to get them with the combination MARK ^.{9}id and the Inverse Bookmark option )

                    After corrections, I ran these regex S/R :

                    • SEARCH (?x) (?<= "id" : \x20 ) \d{4} ,

                    • REPLACE 0$0

                    In order to normalize all the digits, of the id string, to five digits

                    Now, in order to differentiate the item-names.json and the !item-names.json contents, I added, using the column-mode selection :

                    • A last digit 0 to the first 1,589 lines of the All.json file

                    • A last digit 9 to the last 1,536 lines of the All.json file

                    Giving, for instance, at the junction :

                      {	    "id": 610720,	    "Key": "Dyedesc",	    "enUS": "Add this color to your equipment",	    "zhTW": "Add this color to your equipment",	    "deDE": "Add this color to your equipment",	    "esES": "Add this color to your equipment",	    "frFR": "Add this color to your equipment",	    "itIT": "Add this color to your equipment",	    "koKR": "Add this color to your equipment",	    "plPL": "Add this color to your equipment",	    "esMX": "Add this color to your equipment",	    "jaJP": "Add this color to your equipment",	    "ptBR": "Add this color to your equipment",	    "ruRU": "Add this color to your equipment",	    "zhCN": "Add this color to your equipment"	  },
                      {	    "id": 610730,	    "Key": "Dyerdesc",	    "enUS": "Remove this color on your equipment",	    "zhTW": "Remove this color on your equipment",	    "deDE": "Remove this color on your equipment",	    "esES": "Remove this color on your equipment",	    "frFR": "Remove this color on your equipment",	    "itIT": "Remove this color on your equipment",	    "koKR": "Remove this color on your equipment",	    "plPL": "Remove this color on your equipment",	    "esMX": "Remove this color on your equipment",	    "jaJP": "Remove this color on your equipment",	    "ptBR": "Remove this color on your equipment",	    "ruRU": "Remove this color on your equipment",	    "zhCN": "Remove this color on your equipment"	  }
                      {	    "id": 010609,	    "Key": "qf1",	    "enUS": "Khalim's Flail",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                      {	    "id": 010619,	    "Key": "qf2",	    "enUS": "Khalim's Will",	    "zhTW": "克林姆的遺願",	    "deDE": "Khalims Wille",	    "esES": "Voluntad de Khalim",	    "frFR": "Volonté de Khalim",	    "itIT": "Volontà di Khalim",	    "koKR": "칼림의 의지",	    "plPL": "Wola Khalima",	    "esMX": "Voluntad de Khalim",	    "jaJP": "カリムの意志",	    "ptBR": "Vontade de Khalim",	    "ruRU": "Воля Халима",	    "zhCN": "卡林姆的意志"	  },
                      {	    "id": 010629,	    "Key": "KhalimFlail",	    "enUS": "Khalim's Flail",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                      {	    "id": 010639,	    "Key": "SuperKhalimFlail",	    "enUS": "Khalim's Will",	    "zhTW": "克林姆的遺願",	    "deDE": "Khalims Wille",	    "esES": "Voluntad de Khalim",	    "frFR": "Volonté de Khalim",	    "itIT": "Volontà di Khalim",	    "koKR": "칼림의 의지",	    "plPL": "Wola Khalima",	    "esMX": "Voluntad de Khalim",	    "jaJP": "カリムの意志",	    "ptBR": "Vontade de Khalim",	    "ruRU": "Воля Халима",	    "zhCN": "卡林姆的意志"	  },
                    

                    Then I used the Edit > Line Operations > Sort Lines Lexicographically Ascending option to sort the contents of the All.json file

                    After the sort operation, the beginning of the all.json file becomes as below :

                      {	    "id": 010600,	    "Key": "qf1",	    "enUS": "Khalim's Flail",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                      {	    "id": 010609,	    "Key": "qf1",	    "enUS": "Khalim's Flail",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                      {	    "id": 010610,	    "Key": "qf2",	    "enUS": "Khalim's Will",	    "zhTW": "克林姆的遺願",	    "deDE": "Khalims Wille",	    "esES": "Voluntad de Khalim",	    "frFR": "Volonté de Khalim",	    "itIT": "Volontà di Khalim",	    "koKR": "칼림의 의지",	    "plPL": "Wola Khalima",	    "esMX": "Voluntad de Khalim",	    "jaJP": "カリムの意志",	    "ptBR": "Vontade de Khalim",	    "ruRU": "Воля Халима",	    "zhCN": "卡林姆的意志"	  },
                      {	    "id": 010619,	    "Key": "qf2",	    "enUS": "Khalim's Will",	    "zhTW": "克林姆的遺願",	    "deDE": "Khalims Wille",	    "esES": "Voluntad de Khalim",	    "frFR": "Volonté de Khalim",	    "itIT": "Volontà di Khalim",	    "koKR": "칼림의 의지",	    "plPL": "Wola Khalima",	    "esMX": "Voluntad de Khalim",	    "jaJP": "カリムの意志",	    "ptBR": "Vontade de Khalim",	    "ruRU": "Воля Халима",	    "zhCN": "卡林姆的意志"	  },
                      {	    "id": 010620,	    "Key": "KhalimFlail",	    "enUS": "Khalim's Flail",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                      {	    "id": 010629,	    "Key": "KhalimFlail",	    "enUS": "Khalim's Flail",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                    

                    Now, with the following regex S/R, we change two complete consecutive lines, with a same first 5 digits of the id value and a different enUS value with the first line ONLY with a modified enUS value, taken from the corresponding enUS value in the second line :

                    SEARCH (?x-s) ^ ( .{19} ) 0 ( .+? "enUS" : \x20 " ) ( [^"\r\n]+? ) ( " .+ ) \R \1 9 .+? "enUS" : \x20 " (?! \3 " ) ( [^"\r\n]+? ) " .+ \R

                    REPLACE ${1}0\2\5\4\r\n

                    => We get 61 replacements

                    Then, we simply get rid of all the remaining lines of the !item-names.json with that regex S/R :

                    SEARCH (?x-s) ^ ( .{19} ) 9 .+ \R

                    REPLACE Leave EMPTY

                    Afer replacement, it should remain 1,589 lines in the All.json file ( so the same number of lines than in the item-names.json file )


                    We attack the final part of our goal !. We have to get back to the normal layout of a json file. So :

                    • We delete the 6th digit of the id string :

                      • SEARCH (?x) ^ .{19} \K \d

                      • REPLACE Leave EMPTY

                    • We delete the initial 0 digit of the id string

                      • SEARCH (?x) ^ .{14} \K 0

                      • REPLACE Leave EMPTY

                    • We replace any \t character with a normal line-break ( Wait a bit ! )

                      • SEARCH \t

                      • REPLACE \r\n

                    • We add the outer square brackets lines at the very beginning and the very end of the All.json file

                    • Finally, we get back to an Unix file with the Edit > EOL conversion > Unix (LF) option


                    So, @ted-plum, the All.json file now represents your expected data, which replaces your initial item-names.json file !

                    Of course, using the @mark-olson’s Python script is certainly the quicker and best solution, but as you can see, a native N++ solution is also possible !

                    Best Regards,

                    guy038

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

                      Hi, @ted-plum and All,

                      Of course, the search regex which modifies the enUS zones, right after the sort operation, could be simplified if we decide to systematically recopy the enUS values, whatever if these values are equal or different in two consecutive paired lines by id !

                      In that case, the negative look-behind is useless and this regex S/R becomes :

                      SEARCH (?x-s) ^ ( .{19} ) 0 ( .+? "enUS" : \x20 " ) ( .+? ) ( " .+ ) \R \1 9 .+? "enUS" : \x20 " ( .+? ) " .+ \R

                      REPLACE ${1}0\2\5\4\r\n

                      => 1,530 replacements occurred

                      BR

                      guy038

                      P.S. :

                      To easily see the differences between thetwo regexes, test them against the dummy text, below.

                      The first regex S/R, of mmy previous post, just match and change cases where the enUS values are different in consecutive lines id: .....0, and id: .....9, :

                      SEARCH (?x-s) ^ ( .{19} ) 0 ( .+? "enUS" : \x20 " ) ( [^"\r\n]+? ) ( " .+ ) \R \1 9 .+? "enUS" : \x20 " (?! \3 " ) ( [^"\r\n]+? ) " .+ \R

                      REPLACE ${1}0\2\5\4\r\n

                      And this second regex S/R, of my present post, match and change all the cases, whatever the enUS values are equal or different, in consecutive lines id: .....0, and id: .....9, :

                      SEARCH (?x-s) ^ ( .{19} ) 0 ( .+? "enUS" : \x20 " ) ( .+? ) ( " .+ ) \R \1 9 .+? "enUS" : \x20 " ( .+? ) " .+ \R

                      REPLACE ${1}0\2\5\4\r\n

                        {	    "id": 010600,	    "Key": "qf1",	    "enUS": "abcde",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                        {	    "id": 010609,	    "Key": "qf1",	    "enUS": "Khalim's Flail",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                        {	    "id": 010610,	    "Key": "qf2",	    "enUS": "Khalim's Will",	    "zhTW": "克林姆的遺願",	    "deDE": "Khalims Wille",	    "esES": "Voluntad de Khalim",	    "frFR": "Volonté de Khalim",	    "itIT": "Volontà di Khalim",	    "koKR": "칼림의 의지",	    "plPL": "Wola Khalima",	    "esMX": "Voluntad de Khalim",	    "jaJP": "カリムの意志",	    "ptBR": "Vontade de Khalim",	    "ruRU": "Воля Халима",	    "zhCN": "卡林姆的意志"	  },
                        {	    "id": 010619,	    "Key": "qf2",	    "enUS": "Khalim's Will",	    "zhTW": "克林姆的遺願",	    "deDE": "Khalims Wille",	    "esES": "Voluntad de Khalim",	    "frFR": "Volonté de Khalim",	    "itIT": "Volontà di Khalim",	    "koKR": "칼림의 의지",	    "plPL": "Wola Khalima",	    "esMX": "Voluntad de Khalim",	    "jaJP": "カリムの意志",	    "ptBR": "Vontade de Khalim",	    "ruRU": "Воля Халима",	    "zhCN": "卡林姆的意志"	  },
                        {	    "id": 010620,	    "Key": "KhalimFlail",	    "enUS": "*:,$$$---",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                        {	    "id": 010629,	    "Key": "KhalimFlail",	    "enUS": "Khalim's Flail",	    "zhTW": "克林姆的連枷",	    "deDE": "Khalims Kultflegel",	    "esES": "Rompecabezas de Khalim",	    "frFR": "Fléau de Khalim",	    "itIT": "Flagello di Khalim",	    "koKR": "칼림의 도리깨",	    "plPL": "Korbacz Khalima",	    "esMX": "Mangual de Khalim",	    "jaJP": "カリムのフレイル",	    "ptBR": "Mangual de Khalim",	    "ruRU": "Кистень Халима",	    "zhCN": "卡林姆的连枷"	  },
                        {	    "id": 010630,	    "Key": "SuperKhalimFlail",	    "enUS": "Khalim's Will",	    "zhTW": "克林姆的遺願",	    "deDE": "Khalims Wille",	    "esES": "Voluntad de Khalim",	    "frFR": "Volonté de Khalim",	    "itIT": "Volontà di Khalim",	    "koKR": "칼림의 의지",	    "plPL": "Wola Khalima",	    "esMX": "Voluntad de Khalim",	    "jaJP": "カリムの意志",	    "ptBR": "Vontade de Khalim",	    "ruRU": "Воля Халима",	    "zhCN": "卡林姆的意志"	  },
                        {	    "id": 010639,	    "Key": "SuperKhalimFlail",	    "enUS": "Khalim's Will",	    "zhTW": "克林姆的遺願",	    "deDE": "Khalims Wille",	    "esES": "Voluntad de Khalim",	    "frFR": "Volonté de Khalim",	    "itIT": "Volontà di Khalim",	    "koKR": "칼림의 의지",	    "plPL": "Wola Khalima",	    "esMX": "Voluntad de Khalim",	    "jaJP": "カリムの意志",	    "ptBR": "Vontade de Khalim",	    "ruRU": "Воля Халима",	    "zhCN": "卡林姆的意志"	  },
                        {	    "id": 010640,	    "Key": "qey",	    "enUS": "Khalim's Text to be Replaced",	    "zhTW": "克林姆的眼球",	    "deDE": "Khalims Auge",	    "esES": "Ojo de Khalim",	    "frFR": "Œil de Khalim",	    "itIT": "Occhio di Khalim",	    "koKR": "칼림의 눈",	    "plPL": "Oko Khalima",	    "esMX": "Ojo de Khalim",	    "jaJP": "カリムの目",	    "ptBR": "Olho de Khalim",	    "ruRU": "Глаз Халима",	    "zhCN": "卡林姆的眼球"	  },
                        {	    "id": 010649,	    "Key": "qey",	    "enUS": "Khalim's Eye",	    "zhTW": "克林姆的眼球",	    "deDE": "Khalims Auge",	    "esES": "Ojo de Khalim",	    "frFR": "Œil de Khalim",	    "itIT": "Occhio di Khalim",	    "koKR": "칼림의 눈",	    "plPL": "Oko Khalima",	    "esMX": "Ojo de Khalim",	    "jaJP": "カリムの目",	    "ptBR": "Olho de Khalim",	    "ruRU": "Глаз Халима",	    "zhCN": "卡林姆的眼球"	  },
                        {	    "id": 010650,	    "Key": "qbr",	    "enUS": "Khalim's Brain",	    "zhTW": "克林姆的大腦",	    "deDE": "Khalims Gehirn",	    "esES": "Cerebro de Khalim",	    "frFR": "Cerveau de Khalim",	    "itIT": "Cervello di Khalim",	    "koKR": "칼림의 뇌",	    "plPL": "Mózg Khalima",	    "esMX": "Cerebro de Khalim",	    "jaJP": "カリムの脳",	    "ptBR": "Cérebro de Khalim",	    "ruRU": "Мозг Халима",	    "zhCN": "卡林姆的大脑"	  },
                        {	    "id": 010659,	    "Key": "qbr",	    "enUS": "Khalim's Brain",	    "zhTW": "克林姆的大腦",	    "deDE": "Khalims Gehirn",	    "esES": "Cerebro de Khalim",	    "frFR": "Cerveau de Khalim",	    "itIT": "Cervello di Khalim",	    "koKR": "칼림의 뇌",	    "plPL": "Mózg Khalima",	    "esMX": "Cerebro de Khalim",	    "jaJP": "カリムの脳",	    "ptBR": "Cérebro de Khalim",	    "ruRU": "Мозг Халима",	    "zhCN": "卡林姆的大脑"	  },
                      

                      Finally, this second S/R is the right regex to use as it ALSO deletes all the remaining id: .....9 lines, as well. So, it combines two steps in a single one !!

                      Ted PlumT 1 Reply Last reply Reply Quote 2
                      • Ted PlumT
                        Ted Plum @guy038
                        last edited by

                        Hi @guy038 and everyone. I had to take a break from my hobbies because of health issues. Back to it now.

                        @guy038, wow! This is impressive, but way too complex for me to get into at this point. Thanks for the work, and the demonstration, though. I will probably be going the script route for my needs, as it’s more in the way of what I intend to learn for more than hobby purposes. I’ll be using your result for the immediate use.

                        Ted PlumT 1 Reply Last reply Reply Quote 0
                        • Ted PlumT
                          Ted Plum @Ted Plum
                          last edited by

                          @guy038 here’s the file, if you are interested:

                          https://drive.google.com/file/d/1Dq7pltEwqq1ZL54oA2FJCswxubzKQ2Vh/view?usp=sharing

                          1 Reply Last reply Reply Quote 0
                          • guy038G
                            guy038
                            last edited by guy038

                            Hello @ted-plum,

                            By chance, I did not delete the resulting file All.json, created from after our discussion !

                            And the downloading of your file result.json just confirmed me that the creation of the All.json file, with some regexes, from your two files item-names.json and !item-names.json ends up to a file almost identical to the downloaded file ! Indeed, the ONLY differences, found with the ComparePlus plugin, concerned leading indentation in records 61028 and 61029 :

                            • In my All.json file :
                              {
                                "id": 61028,
                                  "Key": "DiabloDesc",
                                  "enUS": "Sell to a vendor to anger the ÿc1Lord of Terror",
                                  "zhTW": "出售给供应商,以激怒恐怖的恐怖",
                                  "deDE": "Verkaufen an einen Anbieter, um den Ÿc1lord des Terrors zu verärgern",
                                  "esES": "Vender a un vendedor para enojar al ÿc1lord de terror",
                                  "frFR": "Vendre à un vendeur pour colère le ÿc1lord de la terreur",
                                  "itIT": "Vendi a un venditore per far arrabbiare il ÿc1lord of terror",
                                  "koKR": "vendor에게 판매하여 테러의 ÿc1lord를 화나게합니다.",
                                  "plPL": "Sprzedać dostawcy, aby gniewić ÿc1 -lord terroru",
                                  "esMX": "Vender a un vendedor para enojar al ÿc1lord de terror",
                                  "jaJP": "ベンダーに販売して、恐怖のc1lordを怒らせる",
                                  "ptBR": "Vender para um fornecedor para raiva do ÿc1lord de terror",
                                  "ruRU": "Продать продавцу, чтобы разозлить ÿc1lord террора",
                                  "zhCN": "出售给供应商,以激怒恐怖的恐怖"
                                },
                              {
                                "id": 61029,
                                  "Key": "dss",
                                  "enUS": "ÿc7Diablo's Soulstone",
                                  "zhTW": "ÿc7暗黑破坏神的灵魂石",
                                  "deDE": "ÿc7Diablos Soulstone",
                                  "esES": "ÿc7Soulstone de Diablo",
                                  "frFR": "ÿc7Diablo's Soulstone",
                                  "itIT": "ÿc7Soulstone di Diablo",
                                  "koKR": "ÿc7디아블로의 소울 스톤",
                                  "plPL": "ÿc7Soulstone Diablo",
                                  "esMX": "ÿc7Soulstone de Diablo",
                                  "jaJP": "ÿc7ディアブロのソウルストーン",
                                  "ptBR": "ÿc7Peda de alma de Diablo",
                                  "ruRU": "ÿc7Diablo's Soulstone",
                                  "zhCN": "ÿc7暗黑破坏神的灵魂石"
                              },
                            
                            • In the downloaded result.json file :
                              {
                                "id": 61028,
                                "Key": "DiabloDesc",
                                  "enUS": "Sell to a vendor to anger the ÿc1Lord of Terror",
                                  "zhTW": "出售给供应商,以激怒恐怖的恐怖",
                                  "deDE": "Verkaufen an einen Anbieter, um den Ÿc1lord des Terrors zu verärgern",
                                  "esES": "Vender a un vendedor para enojar al ÿc1lord de terror",
                                  "frFR": "Vendre à un vendeur pour colère le ÿc1lord de la terreur",
                                  "itIT": "Vendi a un venditore per far arrabbiare il ÿc1lord of terror",
                                  "koKR": "vendor에게 판매하여 테러의 ÿc1lord를 화나게합니다.",
                                  "plPL": "Sprzedać dostawcy, aby gniewić ÿc1 -lord terroru",
                                  "esMX": "Vender a un vendedor para enojar al ÿc1lord de terror",
                                  "jaJP": "ベンダーに販売して、恐怖のc1lordを怒らせる",
                                  "ptBR": "Vender para um fornecedor para raiva do ÿc1lord de terror",
                                  "ruRU": "Продать продавцу, чтобы разозлить ÿc1lord террора",
                                  "zhCN": "出售给供应商,以激怒恐怖的恐怖"
                                },
                              {
                                "id": 61029,
                                "Key": "dss",
                                  "enUS": "ÿc7Diablo's Soulstone",
                                  "zhTW": "ÿc7暗黑破坏神的灵魂石",
                                  "deDE": "ÿc7Diablos Soulstone",
                                  "esES": "ÿc7Soulstone de Diablo",
                                  "frFR": "ÿc7Diablo's Soulstone",
                                  "itIT": "ÿc7Soulstone di Diablo",
                                  "koKR": "ÿc7디아블로의 소울 스톤",
                                  "plPL": "ÿc7Soulstone Diablo",
                                  "esMX": "ÿc7Soulstone de Diablo",
                                  "jaJP": "ÿc7ディアブロのソウルストーン",
                                  "ptBR": "ÿc7Peda de alma de Diablo",
                                  "ruRU": "ÿc7Diablo's Soulstone",
                                  "zhCN": "ÿc7暗黑破坏神的灵魂石"
                              },
                            

                            Thus, my method seems quite safe and gives the right expected results ;-))

                            Best Regards,

                            guy038

                            Ted PlumT 1 Reply Last reply Reply Quote 2
                            • Ted PlumT
                              Ted Plum @guy038
                              last edited by

                              @guy038 those are changes made by me, manually :)

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