Menu

How to delete every line containing string

mejobloggs
2008-10-08
2012-11-13
  • mejobloggs

    mejobloggs - 2008-10-08

    I have a very large text file, and I want to delete every line containing a certain string eg "delete this line"

    How can I do this?

     
    • Fool4UAnyway

      Fool4UAnyway - 2008-10-08

      Did you scan the headlines on this forum's opening page for similar problems?

      Which search terms did you use to find any other messages about this problem?

      Let me challenge you: using two words appearing in the title of your message you can easily find a lot of similar messages, and answers.

      SourceForge is only making things worse, currently, because the page load times are only still increasing. If you want to get quicker results, please go to the SourceForge Community forum by clicking on the Feedback link in the lower right corner of this page. Ask to "give us the old SourceForge back".

       
    • pshute

      pshute - 2008-10-09

      I would look at some of the functions in the TextFX Vix plugin.

       
      • pshute

        pshute - 2008-10-09

        Sorry, not TextFX Vix, TextFX Viz!

         
    • Airdrik

      Airdrik - 2008-10-15

      Or do a regex search and replace: .*delete this line.* with nothing (the '.*' matches all the excess). 

      This will then leave blank lines where the lines with "delete this line" were. 

       
MongoDB Logo MongoDB