Community
    • Login

    is there away to get only the lines containing a particular string to be displayed to allow easier editing

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 315 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.
    • David FindlayD
      David Findlay
      last edited by

      Say you have a file that is 2 or 3 thousand lines long and you need to make changes to just the lines that have a particular string in them but the change depends on the line found.
      No way to predict.
      So after the search is carried out you want to be able to carry on editing but just have those lines displayed.
      When finished you go back to displaying the complete file.

      Alan KilbornA PeterJonesP 2 Replies Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @David Findlay
        last edited by

        @David-Findlay

        Well, there is a “hide lines” feature, but it can’t easily be tied into a search.
        Really, though, I just do a normal “Find All” and then, the lines with the hits are in the Search results panel, and I just double-click on a line there to edit that line, double-click another to edit a different line, etc.
        Note that although it jumps you to the match point in the line, you can certainly move from there to another point in the line to edit, if that’s what you need.
        I understand what you’re asking, I just don’t find it all that necessary, myself.

        David FindlayD 1 Reply Last reply Reply Quote 2
        • PeterJonesP
          PeterJones @David Findlay
          last edited by

          @David-Findlay ,

          Not exactly. But I think I will get something that will work for you.

          1. Use the Search > Mark… dialog to bookmark the matching lines
            • set FIND WHAT to look for the “particular string”
            • checkmark ☑ the box for ☑ Bookmark Line
            • click Clear all marks to make sure that nothing else is marked or bookmarked right now
            • click Mark All – it will mark (color) the matching text and bookmark (● in the left column) the individual lines that have a match
              030aa3c2-40d6-48be-9896-1ddff47bb960-image.png
            • close the Mark dialog
          2. Use the Search > Bookmark > Next/Previous Bookmark (or the F2/Shift+F2 keystroke equivalents) to navigate between the various matches
            • in my screenshot, F2 will move you between line 1, line 3, and line 4

          So it doesn’t hide the other lines, but it makes it easy to navigate to just the matching lines.

          David FindlayD 1 Reply Last reply Reply Quote 1
          • David FindlayD
            David Findlay @Alan Kilborn
            last edited by

            @Alan-Kilborn Thank you. I did not know about being able to double click the line in Search results to jump to that location. Very Helpfull.

            1 Reply Last reply Reply Quote 1
            • David FindlayD
              David Findlay @PeterJones
              last edited by

              @PeterJones Thank you very much. Works well. Wow there is a lot to learn about what notepad++ can do.

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