Menu

Find lines NOT containing a char or string

2007-08-14
2012-11-13
  • Nobody/Anonymous

    Hi,

    I want to find all lines that does NOT contain a specific char (or string) and replace
    it with empty string

    (in other words - I want to delete all lines that doesn't contain a specific char or string)

    How can I do that?

    THX

     
    • Nobody/Anonymous

      Also look into the TextFX Viz menu for another possible solution.

       
    • Nobody/Anonymous

      Is this possible with Notepad++?

       
    • Greg Bullock

      Greg Bullock - 2007-08-14

      Record a macro to copy the current line to another tab then search for the next instance of the search string (F3).  Then populate the Find dialog with the string you want to search, close the Find dialog, and run the macro until end of file.  The new tab will have what you want: only the lines contain the search string.

      Regards.
      Greg