Community
    • Login

    how can i delete these thousands of phrases in quotes without having to do it manually?

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 3 Posters 537 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.
    • DejootaD
      Dejoota
      last edited by

      The replacement tool only works if I specify some phrase, however I would like to know if there is any function that can remove all the phrases that are in quotes.

      Image

      Terry RT 1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R @Dejoota
        last edited by Terry R

        @dejoota said in how can i delete these thousands of phrases in quotes without having to do it manually?:

        however I would like to know if there is any function that can remove all the phrases that are in quotes.

        Although you have shown a lot of phrases, without knowing what else is in the file it might be problematic. Often regular expressions (regex) not only have to find what you are seeking but be designed to exclude what you don’t want affected.

        That said, I’d consider the following using the Replace function (set search mode to regular expression):
        Find What:"[^"]+"
        Replace With: this field is to be empty what effectively means we select something and replace with nothing, so delete it.

        If that doesn’t work I suggest you read the pinned post at the start of the section “Please Read This Before Posting” which will help you to better explain what you have and for us to better help you.

        Terry

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

          Hello, @dejoota, @terry-r and All,

          @dejoota, I suppose that you just want to remove the messages in the last group of double quotes, don’t you ?

          So, here are three regex S/R which achieve this goal. Now, whatever your choice :

          • Open the Replace dialog ( Ctrl + H )

          • Untick all options

          • Tick the Wrap around option

          • Click once on the Replace All button ( Do not use the Replace button if the regex contains a \K syntax )


          Then :

          • If you want to remove, both, the portuguese and the english versions :

            • SEARCH (?-i)[^"]+(?="$)

            • REPLACE Leave EMPTY

          So, from this INPUT text :

          "npc_citizen.question00"	"isto é um teste"
          "[english]npc_citizen.question00"	"This is a test"
          

          you’ll get this first OUTPUT text :

          "npc_citizen.question00"	""
          "[english]npc_citizen.question00"	""
          
          • If you want to remove the portuguese version, only :

            • SEARCH (?-si)^(?="npc_citizen).+"\K[^"]+(?="$)

            • REPLACE Leave EMPTY

          you’ll get this second OUTPUT text :

          "npc_citizen.question00"	""
          "[english]npc_citizen.question00"	"This is a test"
          
          • If you want to remove the english version, only :

            • SEARCH (?-si)^(?="\Q[english]\E).+"\K[^"]+(?="$)

            • REPLACE Leave EMPTY

          you’ll get this third OUTPUT text :

          "npc_citizen.question00"	"isto é um teste"
          "[english]npc_citizen.question00"	""
          

          Best Regards,

          guy038

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