Community
    • Login

    Show only lines that contain a given search argument

    Scheduled Pinned Locked Moved General Discussion
    9 Posts 5 Posters 744 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.
    • N
      nightrider43
      last edited by

      Hey guys!
      How could I make notepad++ show on the screen only lines that contain a certain search argument? For example, all lines of the text being edited that contain the expression “move zero” (without the quotation marks).
      There are editors that even allow the use of and/or.
      “move zero” or “move 9” for example or
      “move zero” and “move 9”.

      EkopalypseE Alan KilbornA Petra HandwergP 3 Replies Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @nightrider43
        last edited by

        @nightrider43

        The answer depends on the specific use case, i.e. what you want to achieve.
        In general, there are ways to get rid of “unwanted lines”, but if you are looking for a built-in way to filter a view of a document and edit that document in that filtered view, then there is not.

        1 Reply Last reply Reply Quote 0
        • Alan KilbornA
          Alan Kilborn @nightrider43
          last edited by

          @nightrider43

          I don’t know that it is really needed.
          I’d use Find All in Current Document.
          Then you have a panel (Search results) that shows you what you are asking for, with an easy “jump to” the real lines that are shown in it.

          N 1 Reply Last reply Reply Quote 3
          • N
            nightrider43 @Alan Kilborn
            last edited by

            @Alan-Kilborn

            I had never realized. This suggestion of yours really meets what I needed. Better than that, only the search results appear directly on the main screen or in a tab instead of a panel with a few lines at the bottom of the screen.
            But that’s right, I recognize that your suggestion solved my problem.
            Thank you very much.

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

              @nightrider43 said in Show only lines that contain a given search argument:

              only the search results appear directly on the main screen or in a tab instead of a panel with a few lines at the bottom of the screen.

              You can resize the panel. Or even pop it out into its own window (see the Panel Mechanics description in the Online User Manual)

              1 Reply Last reply Reply Quote 2
              • Petra HandwergP
                Petra Handwerg @nightrider43
                last edited by

                @nightrider43 I use the “Mark” tab in the search dialogue:

                Find what: (whatever you search)

                Bookmark line

                Wrap around

                (if necessary further settings)
                Click on “Mark All”, then “Close”.

                Goto “Search” > “Bookmark” > “Cut (or Copy) Bookmarked Lines” and paste it whereever you want.

                That’s an alternative way to “Find All in Current Document” - and you don’t need to remove the prefix "Line nn: " in the result list.

                Alan KilbornA 2 Replies Last reply Reply Quote 1
                • Alan KilbornA
                  Alan Kilborn @Petra Handwerg
                  last edited by Alan Kilborn

                  @Petra-Handwerg

                  Just noting that the OP didn’t express a desire for copying lines of interest to another place, but simply “showing lines” as per the title of the thread.

                  But like my post earlier, maybe your post gives others ideas about what they didn’t know they could do.

                  1 Reply Last reply Reply Quote 2
                  • Alan KilbornA
                    Alan Kilborn @Petra Handwerg
                    last edited by

                    @Petra-Handwerg said in Show only lines that contain a given search argument:

                    …an alternative way to “Find All in Current Document” - and you don’t need to remove the prefix "Line nn: " in the result list.

                    And more of what you maybe didn’t know: If you right-click in the Search results window, the popup menu will have a Copy choice and a Copy Lines choice – Copy will get the “Line nn:” info with the line data, whereas Copy Lines will get ONLY the line data.

                    Petra HandwergP 1 Reply Last reply Reply Quote 4
                    • Petra HandwergP
                      Petra Handwerg @Alan Kilborn
                      last edited by

                      @Alan-Kilborn said in Show only lines that contain a given search argument:

                      And more of what you maybe didn’t know: If you right-click in the Search results window, the popup menu will have a Copy choice and a Copy Lines choice – Copy will get the “Line nn:” info with the line data, whereas Copy Lines will get ONLY the line data.

                      Oh, great tip, thank you! I wasn’t aware that the result section has its own context menu.

                      Good to know!

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