Community
    • Login

    Is there a way to hide commands?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    21 Posts 5 Posters 5.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.
    • Volkan ÇolakV
      Volkan Çolak
      last edited by Volkan Çolak

      Hello everyone. I need to ask you the question. Nowadays i am working on something and i need to hide commands if it is possible
      Exampe. <Data ss:Type=“String”>the part i want to see that visible

      Can i hide <Data ss:Type=“String”> </Data> i just want to make "the part i want to see that visible</Data> to visible.

      Is it possible? If yes, it will help me to save lot of hours.

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner @Volkan Çolak
        last edited by

        @Volkan-Çolak

        Your request is far from perfectly clear, but it seems like it boils down to you have some “long” runs of constant(?) text in your document that you would rather not see; you’d like to see something shorter while you are making other edits.

        Well, Notepad++ has no direct support for that, maybe the XML Tools plugin (I don’t use it so I don’t know)…

        If it were me I would do a global replace operation to change the long-form data to the short-form data, work with the text with the shorter form, then run another global replace to restore the original data. This would only work well if the long data is constant…

        1 Reply Last reply Reply Quote 0
        • Volkan ÇolakV
          Volkan Çolak
          last edited by

          Yes because my english is not perfect (or at least i don’t know the terms well)

          My objective is see this >>> hello i am text
          Not this >>> <Data ss:Type=“String”>hello i am text</Data>

          Sorry for my bad english.

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

            @Volkan-Çolak ,

            It sounds to me like you want a WYSIWYG XML editor, which allows you to focus on the content of the XML, rather than the XML structure itself. I do not know of a way to make Notepad++ behave in that manner. (As Scott said, there might be such a feature in XML Tools plugin, but I’m not seeing any of the options that imply that behavior.)

            As a workaround (if you’re willing), you could use the Settings > Style Configurator, choose Language: XML , and set the TAG, TAGEND, TAGUNKNOWN, ATTRIBUTE, and ATTRIBUTEUNKNOWN to a color that closely blends with the background color. However, this is imperfect (the attribute value text still styles as normal text, and the tags are still there and easily accidentally-editable), and may not be sufficient for your needs.

            1 Reply Last reply Reply Quote 1
            • Volkan ÇolakV
              Volkan Çolak
              last edited by

              Uhm thanks i get it but my question is more of this. I want to copy only the NON-HTML content. I need to copy lots of contents EXCEPT OF CODES :(

              Scott SumnerS 1 Reply Last reply Reply Quote 0
              • Scott SumnerS
                Scott Sumner @Volkan Çolak
                last edited by

                @Volkan-Çolak said:

                my question is more of…

                Maybe you should have asked THAT question in the first place.

                Why not view it in a browser and then select and copy the text from there? Clearly we are missing something about this, but you’re going to have to tell what that is before anyone can really help.

                1 Reply Last reply Reply Quote 1
                • Volkan ÇolakV
                  Volkan Çolak
                  last edited by

                  My english is not perfect like yours. I am sorry about that. When i open it with browser, still i can see the HTML codes.

                  Scott SumnerS 1 Reply Last reply Reply Quote 0
                  • Scott SumnerS
                    Scott Sumner @Volkan Çolak
                    last edited by

                    @Volkan-Çolak said:

                    My english is not perfect like yours

                    Mine’s perfect?? no…no…no…

                    Well, you CAN post here in your native language, and most browsers have a “translate this page” option and potential helpers can look at what you’ve written using that method…so if you think that will help you express yourself better, by all means, go ahead.

                    I do maintain, however, that you did change the problem fully.

                    Unfortunately, I’m out of ideas for you; maybe someone else has something that will help.

                    1 Reply Last reply Reply Quote 1
                    • PeterJonesP
                      PeterJones
                      last edited by PeterJones

                      No, when you open the XML file in the browser, what you see is XML tags. You do not see HTML tags (ie, <Data ss:Type="String"> is XML, not HTML). It shows the XML tags because unless you tell the browser how to interpret and present the XML, the browser will default to showing you the tags, because it cannot know what any random XML tag should be interpreted as in terms of equivalent HTML / presentation.

                      I stand by my assertion that what you’re really asking for is an XML WYSIWYG editor, which hides the XML tags from you, allowing you to focus on just the content (the plaintext between the tags, “the part I want to see that visible”).

                      I just went and grabbed an example XML file , and opened it in Microsoft Word; when you tell MS Word to interpret the file as XML, it then gets rid of the tags, and just shows the underlying data. You would then be able to copy to your heart’s content. (I don’t know whether you’d be able to edit/save and still have it be valid XML.)

                      It would very much surprise me if free alternative word processors (such as OpenOffice or LibreOffice Writer) didn’t do something similar with XML. (Sorry, I would have tested, but the only OpenOffice I have access to right now is so old it doesn’t know what XML is. I’m sure a modern one would know.)

                      Alternatively, search around for “XML WYSIWYG editor” or similar.

                      Notepad++ is a great text editor, with lots of features and can be easily extended through plugins… but it is not a word processor, and it is not a WYSIWYG editor which tries to hide the underlying structure so you can focus on content. There may actually be a plugin that does what you want, but I don’t know of any.

                      1 Reply Last reply Reply Quote 1
                      • PeterJonesP
                        PeterJones
                        last edited by

                        Also, if all you’re wanting to do is clean out all the XML tags, so that you can copy the contents/data and do something else with it, you could use a pretty simple regular expression to strip the XML tags. (This wouldn’t let you edit the XML… ie, if you strip out the tags, make an edit, and hit save, it will save the plain text, without any of the XML structure)

                        • Find What = (?s)<[^>]+>
                        • Replace with = `` (empty)
                        • regular expression

                        (Note, if your attribute values have a >, this won’t work.)

                        1 Reply Last reply Reply Quote 0
                        • Volkan ÇolakV
                          Volkan Çolak
                          last edited by

                          Yes sadly i have >. Thanks for everything who trying to help, let me show you the “exactly” what i want. But it translates all codes as well. If i cannot find, i will try to “re-translate” tags to their original values but sadly i have many tags.

                          http://i.hizliresim.com/dBpddD.png

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

                            Hello, @volkan-çolak,

                            I saw, one minute ago, that you’re on-line on our site ! So, just be patient one hour, about, as I found out a solution to your problem and I’m preparing a post to give you the method ;-))

                            See you later,

                            guy038

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

                              Hello, @volkan-çolak, @peterjones, @scott-sumner and All,

                              Aaaaah ! Yes, it took me some time to completely figure out your tricky problem, but I finally found out a solution ;-)) This method is long enough and I advice you to read this post, completely, before going ahead with the different steps to perform !

                              This method consists, principally, in :

                              • Some copy/paste operations, of course

                              • An N++ sort operation

                              • Several searches/replacements, which will use the regular expression search mode

                              In this respect, for each S/R, simply follow these steps :

                              • Open the N++ Replace dialog ( Ctrl + H )

                              • Type in ( or copy/paste ) the SEARCH  regex in the Find what: zone

                              • Type in ( or copy/paste ) the REPLACE  regex in the Replace with: zone

                              • Set the Wrap around option

                              • Select the Regular expression search mode

                              • Click on the Replace All button ( Do not use the Replace button ! )

                              Well, now, let’s go !


                              • From your picture, I simply created a similar code, while trying to get a correct sequence, as below, which represents a short part of your data :
                              <Row ss:StyleID="s3">
                                <Cell>
                                  <Data ss:Type="String">Retreat</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Tears</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Dialog.Option.101.Text</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Scenario Data</Data>
                                </Cell>
                              </Row>
                              <Row ss:StyleID="s3">
                                <Cell>
                                  <Data ss:Type="String">The orc shamans want to join you.</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">The orc shamans want to join you.</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Dialog.Option.358.OptionText</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Scenario Data</Data>
                                </Cell>
                              </Row>
                              <Row ss:StyleID="s3">
                                <Cell>
                                  <Data ss:Type="String">Accept</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Accept</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Dialog.Option.358.OptionText</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Scenario Data</Data>
                                </Cell>
                              </Row>
                              
                              • First, I strongly advice you to do a copy of your original data

                              Remark : We, all, should act as Mother Nature does : it never uses ADN genetic code. It always replicates it, first, as an ARN sequence, which, then, is used for any bio-chemical action ! Believe me, it’s been working… … … for 3,7 billion years !

                              • So, open a COPY of your original file, in Notepad++

                              • Now, using the first S/R, below, it should extract all the white zones of text, that you spoke of, in your picture

                              SEARCH (?s)\s*<.+?"String">\s*|<.+

                              REPLACE \r\n ( or \n if you work on Unix files )

                              You should obtain the different lines, below :

                              Retreat
                              Tears
                              Dialog.Option.101.Text
                              Scenario Data
                              The orc shamans want to join you.
                              The orc shamans want to join you.
                              Dialog.Option.358.OptionText
                              Scenario Data
                              Accept
                              Accept
                              Dialog.Option.358.OptionText
                              Scenario Data
                              
                              • Choose, now, the menu command Edit > Line Operations > Sort Lines Lexicographically Ascending. your text becomes sorted, as below :
                              Accept
                              Accept
                              Dialog.Option.101.Text
                              Dialog.Option.358.OptionText
                              Dialog.Option.358.OptionText
                              Retreat
                              Scenario Data
                              Scenario Data
                              Scenario Data
                              Tears
                              The orc shamans want to join you.
                              The orc shamans want to join you.
                              
                              • Perform, then, the following S/R, in order to delete all duplicate lines of that list :

                              SEARCH ^(.*\R)\1+

                              REPLACE \1

                              you should obtain this shortened list :

                              Accept
                              Dialog.Option.101.Text
                              Dialog.Option.358.OptionText
                              Retreat
                              Scenario Data
                              Tears
                              The orc shamans want to join you.
                              

                              • Now, paste the different lines of this American-English text, on an on-line translator. You said that you generally, use the Google one, but, personally, I prefer the translator, below, based on neuronal networks, which is really very efficient ::-)

                              https://www.deepl.com/translator

                              Well. So, let’s imagine that we would like to translate in French, using deepl.com site. We get the French list, below, that we paste, back, in N++ :

                              Accepter
                              Option.de.dialogue.101.Texte
                              Option.Dialog.Option.358.OptionText
                              Se retirer
                              Données de scénario
                              Larmes
                              Les chamans orcs veulent se joindre à vous.
                              

                              I simply changed the French nom "Retraite " with the French verb "Se retirer ", which is better, given the context !


                              • Now, we’re about to build the correct file, in order to run our last S/R ! So, in a new N++ tab :

                                • Insert your original data, first :

                                • Add a new line, made up several equal signs as, for instance ==================

                                • Append all the English sentences, that we extracted, at first step

                                • Add, again, a line ==================

                                • Finally, add the French sentences, obtained from the on-line translator

                              This text should be, as below :

                              <Row ss:StyleID="s3">
                                <Cell>
                                  <Data ss:Type="String">Retreat</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Tears</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Dialog.Option.101.Text</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Scenario Data</Data>
                                </Cell>
                              </Row>
                              <Row ss:StyleID="s3">
                                <Cell>
                                  <Data ss:Type="String">The orc shamans want to join you.</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">The orc shamans want to join you.</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Dialog.Option.358.OptionText</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Scenario Data</Data>
                                </Cell>
                              </Row>
                              <Row ss:StyleID="s3">
                                <Cell>
                                  <Data ss:Type="String">Accept</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Accept</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Dialog.Option.358.OptionText</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Scenario Data</Data>
                                </Cell>
                              </Row>
                              ===================================================
                              Accept
                              Dialog.Option.101.Text
                              Dialog.Option.358.OptionText
                              Retreat
                              Scenario Data
                              Tears
                              The orc shamans want to join you.
                              ===================================================
                              Accepter
                              Option.de.dialogue.101.Texte
                              Option.Dialog.Option.358.OptionText
                              Se Retirer
                              Données de scénario
                              Larmes
                              Les chamans orcs veulent se joindre à vous.
                              

                              Almost done !

                              • We just have to run the last regex S/R, below, which changes all American/English sentences, in your code, with the matched French translation of these sentences !

                              SEARCH (?-s)(?<="String">)(.+?)(?=</Data>(?s).+^=+.*?\R\1\R(?-s)(?:.+\R){7}(.+))|(?s)^=+.+

                              REPLACE \2

                              IMPORTANT : The number seven, in the syntax {7}, is the total number of lines translated. Thus, le number 7, in our example


                              After replacement, you’re left with the expected text, containing translated “white” sentences, only ;-))

                              <Row ss:StyleID="s3">
                                <Cell>
                                  <Data ss:Type="String">Se Retirer</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Larmes</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Option.de.dialogue.101.Texte</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Données de scénario</Data>
                                </Cell>
                              </Row>
                              <Row ss:StyleID="s3">
                                <Cell>
                                  <Data ss:Type="String">Les chamans orcs veulent se joindre à vous.</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Les chamans orcs veulent se joindre à vous.</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Option.Dialog.Option.358.OptionText</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Données de scénario</Data>
                                </Cell>
                              </Row>
                              <Row ss:StyleID="s3">
                                <Cell>
                                  <Data ss:Type="String">Accepter</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Accepter</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Option.Dialog.Option.358.OptionText</Data>
                                </Cell>
                                <Cell>
                                  <Data ss:Type="String">Données de scénario</Data>
                                </Cell>
                              </Row>
                              

                              Et voilà !

                              Next time, I’ll give you some explanations on the regexes used, if you want to !

                              Best Regards,

                              guy038

                              Volkan ÇolakV 1 Reply Last reply Reply Quote 4
                              • Jim DaileyJ
                                Jim Dailey
                                last edited by

                                @guy038

                                Incroyable ! Nous avons besoin d’un bouton de vote à la hausse qui ajoute 10 votes !

                                :-)

                                1 Reply Last reply Reply Quote 2
                                • PeterJonesP
                                  PeterJones
                                  last edited by

                                  Assuming that says what I think it says (I saw “button vote … 10 votes”), I second that motion. Actually, I square that motion; I would give +100 for that answser. :-)

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

                                    Hi, @jim-dailey and @peterJones,

                                    Thank you, guys, but I believe that we should remain modest ! Anyway, you, both, provide very detailed posts on various topics, too ! So, I could return the compliment to you !

                                    We, all, just do our best to help anyone, when we think of a right solution ;-))

                                    Cheers,

                                    guy038

                                    1 Reply Last reply Reply Quote 0
                                    • Jim DaileyJ
                                      Jim Dailey
                                      last edited by

                                      @guy038

                                      guy038> Thank you, guys, but I believe that we should remain modest !

                                      Not to invite or start a political war, but I have to say, you’ll never be President of the U.S. with that kind of attitude!

                                      :-)

                                      Volkan ÇolakV 1 Reply Last reply Reply Quote 1
                                      • Volkan ÇolakV
                                        Volkan Çolak @guy038
                                        last edited by

                                        @guy038 Omg i haven’t read it yet but even if you succeed or not, you deserve respect. Before i begin (tonight i will available) i truly wanted to thank you so much!

                                        1 Reply Last reply Reply Quote 0
                                        • Volkan ÇolakV
                                          Volkan Çolak @Jim Dailey
                                          last edited by

                                          @Jim-Dailey Ehm. First of all thank you but it seems my knowledge + my english is unsufficient for this :( i felt guilty but i wasn’t expected it to be a difficult like this. I was tought it could be the plugin that can hides html codes :(

                                          1 Reply Last reply Reply Quote 0
                                          • Jim DaileyJ
                                            Jim Dailey
                                            last edited by

                                            @Volkan-Çolak

                                            I think we are having language difficulties.

                                            I did not help answer your question at all, so I’m not sure why you would thank me. But, you are welcome!

                                            I just tried to praise @guy038 for his amazing answer (using the site he mentioned, https://www.deepl.com/translator, so that I could post in French, which I assume is Guy’s native language).

                                            Then made a poor joke about his reply to my French posting.

                                            I think you will find Guy’s post very useful. Best of luck!

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