![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sed: deleting 5 lines after a specified pattern | pcwiz | Shell Programming and Scripting | 3 | 08-14-2009 11:48 AM |
| counting the lines matching a pattern, in between two pattern, and generate a tab | d.chauliac | Shell Programming and Scripting | 4 | 03-19-2009 01:30 PM |
| deleting lines after pattern using sed | larne | Shell Programming and Scripting | 2 | 10-13-2008 01:54 PM |
| Pattern Matching and lines after that | kaushys | Shell Programming and Scripting | 4 | 06-23-2008 12:27 PM |
| pattern matching over more lines | trek | Shell Programming and Scripting | 3 | 04-22-2008 07:37 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
pattern matching over multiple lines and deleting the first
I've got a longish log file with content such as
Uplink traffic: Downlink traffic: I want to parse the log file and remove any line that contains the string "Uplink traffic:" at the beginning of the line, but only if the line following it beginnings with the string "Downlink traffic:" (in other words a grep -v won't work) |
|
||||
|
In cases where successive lines are of the form
Uplink traffic: Downlink traffic: I want the "Uplink traffic:" line removed In cases where successive lines are of the form Uplink traffic: Dropped packets: 40 Downlink traffic: I don't want the "Uplink traffic:" line removed |
|
||||
|
Check the script , I guess it wont give the desired result as "yorkie99" expected.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|