• Login
Community
  • Login

about selection

Scheduled Pinned Locked Moved General Discussion
47 Posts 7 Posters 11.4k 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.
  • C
    cisco779k
    last edited by Apr 1, 2020, 7:24 AM

    i have one txt like this:

    pacecececrst$$$!
    ###
    peerfergeg4Me<123
    17ergergom/file/wv7PNHVud9kAerAP3_WO-g/1554th0810.7zg
    1ergergergegQy2iSLvFyoduWHrUjN7g/1554th18.7zg
    ergergerggupload.com/filerge/uU8CesyKVkPb4MWk_0VqkQ/1554th11.7z
    ergergerge34r43r343
    ###
    pasdcd555ye2018
    6664lekrflkeuN3s5lmSigp56oveKPp6w/erferfef3443r3434
    15o4fkfk4lf,dfmemfgermp
    ###
    paerf3904r903ur3jgj
    

    how to select all text excepted ### line?

    and another: if i put bookmark on each line with ###
    then from search - bookm - invers bookmark
    how to select all bookm lines?

    E 1 Reply Last reply Apr 1, 2020, 9:38 AM Reply Quote 0
    • E
      Ekopalypse @cisco779k
      last edited by Apr 1, 2020, 9:38 AM

      @cisco779k

      Afaik only by pressing the CTRL key, keep pressing and selecting the
      parts with the mouse.
      Note, you need to have Settings->Preferences->Editing->Multi-Editing Settings->Enabled checked.

      May I ask you what you want to do with the selection?
      I mean, it doesn’t make sense to select the lines only, obviously you
      want to do something with it, won’t you?

      1 Reply Last reply Reply Quote 2
      • C
        cisco779k
        last edited by Apr 1, 2020, 12:55 PM

        yes i know Multi-Editing Settings
        but i want select batch part on my file… very long file, and multi selection with CTRL for me it’s not convenient…
        first my question it is intended as general information (about selection).
        on this specific case i want select all line except line ###, then with reverse line plug-in i want change my line order.
        then i thought to put with mark - bookmark all ### line, invert bookm, but after i need to select all this line to use reverse line plug-in…

        A 1 Reply Last reply Apr 1, 2020, 1:03 PM Reply Quote 0
        • A
          Alan Kilborn @cisco779k
          last edited by Apr 1, 2020, 1:03 PM

          @cisco779k

          …select all line except line ###, then with reverse line plug-in i want change my line order

          I think it is going to all come crashing down when you realize that the Reverse Lines plugin does not work correctly when multiple selections are in effect.

          1 Reply Last reply Reply Quote 2
          • C
            cisco779k
            last edited by Apr 1, 2020, 3:51 PM

            yes. reverse line plug-in not work correctly with multiple selection…
            anyway have solution to select all bookmark?
            or select all line excluded some line with ### symbol?

            A A 2 Replies Last reply Apr 1, 2020, 5:04 PM Reply Quote 0
            • A
              Alan Kilborn @cisco779k
              last edited by Apr 1, 2020, 5:04 PM

              @cisco779k

              Probably the best way for anyone to help you, is to help us by answering @Ekopalypse 's questions that you’ve so far largely ignored:

              May I ask you what you want to do with the selection?
              I mean, it doesn’t make sense to select the lines only, obviously you
              want to do something with it, won’t you?

              Given that we don’t know your real plans for these selections, might I suggest, after you’ve gotten your desired lines bookmarked, to copy them to a new file and continue working with them there?

              1 Reply Last reply Reply Quote 2
              • A
                astrosofista @cisco779k
                last edited by Apr 1, 2020, 6:40 PM

                @cisco779k said in about selection:

                yes. reverse line plug-in not work correctly with multiple selection…
                anyway have solution to select all bookmark?
                or select all line excluded some line with ### symbol?

                Hi @cisco779k, All

                Yes, it is possible to select all lines separated by hash symbols ( ### ) with a S/R regex, like the following:

                Search: (?s)(?<=###\v\v).*?(?=\v\v###)
                Replace: [leave empty]
                

                Maybe I’m completely wrong, but I guess you want to use the reverse line plugin to flip lines locally —that is, reverse all the lines between hashes and only those— and don’t want to run a global reverse operation. I mean this (lines truncated for displaying reasons):

                pacecececrst$$$!                   pacecececrst$$$!
                ###                                ###
                peerfergeg4Me<123                  ergergerge34r43r343
                17ergergom/file/wv7PNHVud9kA       ergergerggupload.com/filerge/uU8CesyKVkPb4MWk_0VqkQ/1554th11.7z
                1ergergergegQy2iSLvFyoduWHrU       1ergergergegQy2iSLvFyoduWHrUjN7g/1554th18.7zg
                ergergerggupload.com/filerge       17ergergom/file/wv7PNHVud9kAerAP3_WO-g/1554th0810.7zg
                ergergerge34r43r343                peerfergeg4Me<123
                ###                                ###
                pasdcd555ye2018                    15o4fkfk4lf,dfmemfgermp
                6664lekrflkeuN3s5lmSigp56ove       6664lekrflkeuN3s5lmSigp56oveKPp6w/erferfef3443r3434
                15o4fkfk4lf,dfmemfgermp            pasdcd555ye2018
                ###                                ###
                paerf3904r903ur3jgj                paerf3904r903ur3jgj
                

                If this is the outcome you want, I think is doable, though a bit complex. Anyway, if you can illustrate your needs with some examples it will be greatly appreciated.

                Best Regards

                T 1 Reply Last reply Apr 3, 2020, 12:05 AM Reply Quote 2
                • C
                  cisco779k
                  last edited by Apr 2, 2020, 8:15 AM

                  yes Alan, right advice, that’s what i did!
                  i have solved with this: on reg-ex i have use this (?!^.###.$)^.+
                  with mark function to bookmark ALL line which do NOT contain ### (and this was something , wanted), then i have copy into new txt and used reverse line plugin to end my job.

                  @ astrosofista
                  you understand what I want to do. and although I have solved it, I want to understand for other jobs…
                  then, your reg-ex menthioned above work fine, but this work to FIND fields, it is not a selection!
                  we leave out the second part, which you have perfectly understood, but I have already solved, how to have real selection of my text included into ### symbol?

                  1 Reply Last reply Reply Quote 0
                  • C
                    cisco779k
                    last edited by Apr 2, 2020, 12:50 PM

                    i’ve write my post above 5 hours ago. now i want edit, but is not possible… i must wait 3 minute after edit my post! the site must have something that doesn’t work well …
                    anyway: @ astrosofista keep my bad post above; your regex work fine and with mark all each field between ### is selected with bookmarks.
                    I was interested in this. Thank you for your contribution!

                    A 1 Reply Last reply Apr 2, 2020, 3:12 PM Reply Quote 0
                    • A
                      Alan Kilborn
                      last edited by Apr 2, 2020, 12:57 PM

                      @cisco779k said in about selection:

                      I’ve write my post above 5 hours ago. now i want edit, but is not possible

                      Correct; basically you have 3 minutes to edit a post. After that, you just create a new post with new information, or revise old information by discussing it in that new post.

                      1 Reply Last reply Reply Quote 0
                      • C
                        cisco779k
                        last edited by Apr 2, 2020, 1:19 PM

                        ah ok! thanks for the clarification!

                        1 Reply Last reply Reply Quote 0
                        • A
                          astrosofista @cisco779k
                          last edited by Apr 2, 2020, 3:12 PM

                          @cisco779k said in about selection:

                          anyway: @ astrosofista … your regex work fine and with mark all each field between ### is selected with bookmarks.
                          I was interested in this. Thank you for your contribution!

                          Great, it’s good to hear that the regex worked fine :)

                          Just in case you still need it, here it goes another regex, but this one only selects the hashes ###, so it does the opposite of the one posted yesterday. Click on Find Next to navigate through the file:

                          Search: (?s)[^#]+\R\K.*?(?=\R[^#])
                          Replace: [leave empty]
                          

                          Best Regards

                          A 2 Replies Last reply Apr 2, 2020, 3:47 PM Reply Quote 1
                          • A
                            Alan Kilborn @astrosofista
                            last edited by Alan Kilborn Apr 2, 2020, 3:48 PM Apr 2, 2020, 3:47 PM

                            @astrosofista :

                            It might be better to express regexes like this (inside of backticks) instead of the way you did it:

                            (?s)[^#]+\R\K.*?(?=\R[^#])

                            Whenever I see regexes with italics in them here, I think, uhoh, a * got consumed. Note that this is NOT the case for your posting (the regex is fine!), but the wacky italics and color is still “disturbing”.

                            Just a suggestion.

                            A 1 Reply Last reply Apr 2, 2020, 6:20 PM Reply Quote 2
                            • C
                              cisco779k
                              last edited by Apr 2, 2020, 4:18 PM

                              tanxs to both of them for your reg-ex.
                              however i don’t understand why to use reg-ex when on this simple case just enter in search field (or mark) ### …

                              A 1 Reply Last reply Apr 2, 2020, 6:52 PM Reply Quote 0
                              • A
                                Alan Kilborn @astrosofista
                                last edited by Apr 2, 2020, 5:12 PM

                                @astrosofista said in about selection:

                                here it goes another regex, but this one only selects the hashes ###,

                                Also, your choice of terminology here (“selects”) probably only confuses the OP. Probably the word “finds” would have been the better way to go. :-)

                                1 Reply Last reply Reply Quote 0
                                • C
                                  cisco779k
                                  last edited by Apr 2, 2020, 6:04 PM

                                  no confusion. my initial intent (clearly expressed) was a selection of the text from the ### fields.
                                  but since this selection is not possible, then i use the mark to make a copy & paste.

                                  1 Reply Last reply Reply Quote 0
                                  • A
                                    astrosofista @Alan Kilborn
                                    last edited by Apr 2, 2020, 6:20 PM

                                    @Alan-Kilborn

                                    Now I see —aging eyes here—, thank you, didn’t noticed till now that italics being applied after the * — maybe we need an escape character for avoid that, ha ha.

                                    OTOH, I like the message structure or disposition, were the regex is on its own line.

                                    Well, will see what can I do.

                                    1 Reply Last reply Reply Quote 0
                                    • A
                                      astrosofista @cisco779k
                                      last edited by Apr 2, 2020, 6:52 PM

                                      @cisco779k

                                      Three reasons I can think of:

                                      1. Error prevention. Regex provides more control than the normal mode, so I can make sure to only match what it is needed —as I haven’t checked the actual file and as I only had seen a sample—, I don’t know if those three hashes are also located in the middle of the file.
                                      2. More error prevention. Regex also provides a way to override options that the user inadvertently may have checked. Thus, in the last regex (?s) forces the regex to run a multiline search.
                                      3. Personal habit. In my Notepad++ the regex mode is always checked, so my first attempt is to run even simple searches in that mode. I only select the normal mode in order to avoid regex metacharacters intrusion — and get back to regex realm as soon as possible :)
                                      A 2 Replies Last reply Apr 2, 2020, 7:15 PM Reply Quote 1
                                      • A
                                        Alan Kilborn @astrosofista
                                        last edited by Apr 2, 2020, 7:15 PM

                                        @astrosofista said in about selection:

                                        I only select the normal mode in order to avoid regex metacharacters intrusion — and get back to regex realm as soon as possible

                                        Or you could just stay permanently in the regex realm (Search mode = Regular expression) and just lead off any “normal” searches you need to do (because of metacharacters) with a quick \Q – no need to bother with a trailing \E ! :-)

                                        You can’t do a Whole word search this way, though, if you ever use that option, because that checkbox is disabled (but you could go to the trouble of adding \b before the \Q and at the other end).

                                        A 1 Reply Last reply Apr 2, 2020, 8:42 PM Reply Quote 2
                                        • A
                                          Alan Kilborn @astrosofista
                                          last edited by Apr 2, 2020, 7:20 PM

                                          @astrosofista said:

                                          …didn’t noticed till now that italics being applied after the * — maybe we need an escape character for avoid that

                                          I think maybe we have a misunderstanding. Your regexes in this thread are fine, I was just suggesting

                                          this method

                                          instead of

                                          this method
                                          

                                          because the second method does some lexing (does it think it is C++ above because it has special highlighting for “this”?) and the first method just leaves everything alone (and thus is probably clearer).

                                          A 1 Reply Last reply Apr 2, 2020, 7:59 PM Reply Quote 3
                                          4 out of 47
                                          • First post
                                            4/47
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors