LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to filter lines from a text file (https://www.linuxquestions.org/questions/linux-software-2/how-to-filter-lines-from-a-text-file-109547/)

Rascale 10-28-2003 12:35 PM

How to filter lines from a text file
 
I have some email files that a spam scanner has appended several lines of text to the bottom. I need to remove these footers. Each line to be removed has some unique text I can identify it with, but overall, the lines can be different. This task must be repeated daily. What program could I use to do this without manually editing each file?

I figured if I could search the file for all lines that did *not* contain the strings and pipe it to a file, it would work. I tried using grep, but I could only figure out how to find lines *with* the strings but not without.

Any suggestions are appreciated.

Thanks,
-->Russ

ToniT 10-28-2003 12:46 PM

grep -v


All times are GMT -5. The time now is 06:03 PM.