Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-28-2003, 12:35 PM   #1
LQ Newbie
Registered: Oct 2003
Distribution: RH ES 3, ES 4, SLES 10.2
Posts: 9

Rep: Reputation: 0
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.

Old 10-28-2003, 12:46 PM   #2
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
grep -v


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Grab text lines in text file LULUSNATCH Programming 1 12-02-2005 10:55 AM
Splitting Text lines? 0aniel Programming 9 11-30-2005 03:08 AM
adding text to lines in a file tpreitano Linux - General 2 10-04-2005 09:30 AM
Remove odd lines from a text file Mr. Gone Programming 2 09-19-2005 11:16 AM
Loop over lines in text file? amaze Linux - General 2 08-12-2003 07:15 AM

All times are GMT -5. The time now is 07:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration