Sponsored Content
Top Forums Shell Programming and Scripting pattern matching over multiple lines and deleting the first Post 302368632 by Yorkie99 on Thursday 5th of November 2009 08:03:49 AM
Old 11-05-2009
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)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

counting the lines matching a pattern, in between two pattern, and generate a tab

Hi all, I'm looking for some help. I have a file (very long) that is organized like below: >Cluster 0 0 283nt, >01_FRYJ6ZM12HMXZS... at +/99% 1 279nt, >01_FRYJ6ZM12HN12A... at +/99% 2 281nt, >01_FRYJ6ZM12HM4TS... at +/99% 3 283nt, >01_FRYJ6ZM12HM946... at +/99% 4 279nt,... (4 Replies)
Discussion started by: d.chauliac
4 Replies

2. Shell Programming and Scripting

Finding lines matching the Pattern and their previous lines in a file

Hi, I am trying to locate the occurences of certain pattern like 'Possible network disconnect' in a text file. I can get the actual lines matching the pttern using: grep -w 'Possible network disconnect' file_name. But I am more interested in getting the timing of these events which are... (7 Replies)
Discussion started by: sagarparadkar
7 Replies

3. Shell Programming and Scripting

Deleting lines from a stream after matching a pattern

Hi, I have a requirement to to an ldapsearch and remove the shadow attributes in the output file. What I do is ldapsearch() | operation to remove shadow > FILE The ldapsearch gives output like this(with same line formation): objectClass: FSConfig objectClass: extensibleObject fsCAIP:... (10 Replies)
Discussion started by: lorzinian
10 Replies

4. Shell Programming and Scripting

Multiple pattern matching using awk and getting count of lines

Hi , I have a file which has multiple rows of data, i want to match the pattern for two columns and if both conditions satisfied i have to add the counter by 1 and finally print the count value. How to proceed... I tried in this way... awk -F, 'BEGIN {cnt = 0} {if $6 == "VLY278" &&... (6 Replies)
Discussion started by: aemunathan
6 Replies

5. Shell Programming and Scripting

Deleting a matching string(line) which is also in other lines

Hi, i need help with my shell script I have a file input.txt containing the following contents /. /usr /usr/share /usr/share/doc /usr/share/doc/wine /usr/share/doc/wine/copyright /usr/share/doc/wine/changelog.Debian.gz I need output as /usr/share/doc/wine /usr/share/doc/wine/copyright... (3 Replies)
Discussion started by: Amit0991
3 Replies

6. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies

7. Shell Programming and Scripting

Deleting lines on matching certain pattern

hi I have a large xml file from which i have taken few lines . In this file I have to find for the string </invoices> and check if the 3 rd line after this string does not begin with <portCode> ,then i have to delete the string </invoices> and the next line having the string </shippingBill>... (13 Replies)
Discussion started by: sunnyboy
13 Replies

8. UNIX for Dummies Questions & Answers

Grep -v lines starting with pattern 1 and not matching pattern 2

Hi all! Thanks for taking the time to view this! I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern. Example: Drink a soda Eat a banana Eat multiple bananas Drink an apple juice Eat an apple Eat multiple apples I... (8 Replies)
Discussion started by: demmel
8 Replies

9. Shell Programming and Scripting

Removing multiple lines from input file, if multiple lines match a pattern.

GM, I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed. I am assuming that sed, awk or even perl could do what I need. I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies

10. Shell Programming and Scripting

Group Multiple Lines on SINGLE line matching pattern

Hi Guys, I am trying to format my csv file. When I spool the file using sqlplus the single row output is wrapped on three lines. Somehow I managed to format that file and finally i am trying to make the multiple line on single line. The below command is working fine but I need to pass the... (3 Replies)
Discussion started by: RJSKR28
3 Replies
IDT(4)                                                     BSD Kernel Interfaces Manual                                                     IDT(4)

NAME
idt -- device driver for IDT NICStAR-based ATM interfaces SYNOPSIS
device idt device atm DESCRIPTION
The idt device driver supports ATM network interfaces based on the IDT NICStAR 77211 controller, including the FORE Systems ForeRunner LE25 and LE155. For configuring the card for IP see natmip(4). ATM CBR connections are supported, and bandwidth is allocated in slots of 64k each. Three VBR queues handle traffic for VBR and UBR. Two UBR queues prioritize UBR traffic. ILMI and signalling get the higher priority queue, as well as UBR traffic that specifies a peak cell rate. All other UBR traffic goes into the lower queue. The following sysctls are recognized by the driver: hw.idt.log_bufstat Print statistics about buffer use to the system log periodically. hw.idt.log_vcs Print information about VC opens, closes, and other events to the system log. hw.idt.bufs_large Set or print the maximum size of the 2KB buffer queue. hw.idt.bufs_small Set or print the maximum size of the mbuf queue. hw.idt.cur_large Print the current size of the 2KB buffer queue. hw.idt.cur_small Print the current size of the mbuf queue. hw.idt.qptr_hold Optimize the TX queue buffer for lowest overhead. SEE ALSO
natm(4), natmip(4), ifconfig(8), route(8) AUTHORS
Richard Hodges, based on the original driver for FreeBSD 2.2 by Mark Tinguely. Bruce M. Simpson wrote this manual page and backported the driver to FreeBSD 4.9. BSD June 3, 2003 BSD
All times are GMT -4. The time now is 03:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy