For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > March 2005 > Text Search/Delete









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Text Search/Delete
Greg Schiedler

2005-03-30, 3:56 am

OK I need to parse a rather large logfile and delete specific lines.
The file is called logfile and is simply a large text file.

Is there some simple way to read in the file and delete specific lines
that contain DSL:user@domain.com and the rerun the process to delete
user2@domain.com -or-
Delete all lines that contain: "DSL:" and the text :No such user"

Greg


Sample logfile....

Wed Jan 5 05:35:57 2005: DSL:user@domain.com::POP::No such user
.....
.....
Sat Mar 26 08:54:04 2005: DSL:user2@domain.com::POP::No such user
Sat Mar 26 08:54:10 2005: DSL:user2@domain.com::POP::No such user
Sat Mar 26 08:54:16 2005: DSL:user2@domain.com::POP::No such user
Sat Mar 26 08:54:23 2005: DSL:user2@domain.com::POP::No such user
Sat Mar 26 08:54:29 2005: DSL:user2@domain.com::POP::No such user
Sat Mar 26 08:54:35 2005: DSL:user2@domain.com::POP::No such user
....
....

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com