in reply to Parsing cisco log file
So you want the line printed if it does not end in "matches)"? That could be as simple as:
Assuming you've already opened LOG to the right file, and that you're feeding the file to the program on standard input.while (<STDIN>) { # This is backwards, see update below. # next unless /matches\)$/; # print LOG; print LOG unless /matches\)$/; }
Or did I misunderstand your question entirely?
Update
I forgot to mention, there's a bunch of code and information about working with cisco routers in the monastery. Follow that link, or type "cisco" in the search box at the top of the page. You may find your problem solved already.
Update 2
The logic in the original snippet was backwards. Thanks to guha for spotting it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parsing cisco log file
by routedude (Initiate) on Mar 06, 2003 at 20:42 UTC | |
by VSarkiss (Monsignor) on Mar 06, 2003 at 21:53 UTC |