Community
    • Login

    How to replace all numbered ID with a list of name in different languages

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 280 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.
    • Farhan SyabibiF
      Farhan Syabibi
      last edited by

      So i have a master txt file that contain some keyword of an item ID, for example

      ID0001
      ID0002
      ID0003

      Then i want to make a copy of that and replace all IDxxxx into a name that match the ID but in different languages, like:

      ID0001, Bicycle, Fahrrad, Bicicletta

      So essentially replace id0001 into bicycle in different languages, but just one language for one copy of the files

      Mark OlsonM Thomas KnoefelT 3 Replies Last reply Reply Quote 0
      • Mark OlsonM
        Mark Olson @Farhan Syabibi
        last edited by

        @Farhan-Syabibi
        This is a job for a scripting language like Python or PowerShell. If you need help writing scripts in a scripting language, this is the wrong place to ask questions.

        Somebody else might chime in with a way to use Notepad++ builtin functionality or plugins to solve your problem, but IMO that is much less efficient than just using a scripting language.

        1 Reply Last reply Reply Quote 2
        • Thomas KnoefelT
          Thomas Knoefel @Farhan Syabibi
          last edited by Thomas Knoefel

          @Farhan-Syabibi
          You can achieve this with the MultiReplace Plugin, but for simplicity, I recommend splitting the replacement tasks into different languages.

          To do this, create a replacement list in the MultiReplace Plugin that looks like this:
          9c0e972c-ebe1-4943-852e-0ecc0f06980f-image.png

          You can also generate the Replacement list as it is stored in CSV format.

          1 Reply Last reply Reply Quote 1
          • Thomas KnoefelT
            Thomas Knoefel @Farhan Syabibi
            last edited by Thomas Knoefel

            @Farhan-Syabibi

            I gave a more advanced version with MultiReplace a go. But try version of the previous post first.

            Enable ‘Use Variables’ before adding each line into the list.

            By changing the number for LANG in the init part from 1 to 3, you can switch between the language replacements. Just right click on the entry and choose 'Edit Field ’ in the Context menu.

            But I have to mention. It is necessary to combine the init command with a single match that appears first in the document; otherwise, the init will not be triggered and the following lines are failing. Or you put the init into each line.

            So list look finally like this:
            5669c085-8004-4e4a-bf02-cbfc5a0b7ffe-image.png

            Simply copy-paste this raw data into the replacement list, for testing:

            1,"ID0001","init({LANG=3});set((({""Bicycle"", ""Fahrrad"", ""Bicicletta""})[LANG]) );",0,0,1,0,0
            1,"ID0002","set(({""Mountain Bike"", ""Mountainbike"", ""Bicicletta da montagna""})[LANG]);",0,0,1,0,0
            1,"ID0003","set(({""Airplane"", ""Flugzeug"", ""Aeroplano""})[LANG]);",0,0,1,0,0
            
            Farhan SyabibiF 1 Reply Last reply Reply Quote 1
            • Farhan SyabibiF
              Farhan Syabibi @Thomas Knoefel
              last edited by

              @Thomas-Knoefel
              I see, thanks i will try that later

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