Sponsored Content
Top Forums Shell Programming and Scripting Reporting lines above a particular pattern Post 302661255 by itkamaraj on Monday 25th of June 2012 05:28:54 AM
Old 06-25-2012
Code:
 
$ awk '/Path.*good/{a=1}!a{line=line"\n"$0}/VIOL/{if(a){print line"\n"$0}}' input.txt
Startpoint: ff1
(rising edge-triggered flip-flop clocked by CLK3)
Endpoint: ff4
(rising clock gating-check end-point clocked by CLK4)
VIOL = 10

This User Gave Thanks to itkamaraj For This Post:
 

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

sed pattern to delete lines containing a pattern, except the first occurance

Hello sed gurus. I am using ksh on Sun and have a file created by concatenating several other files. All files contain header rows. I just need to keep the first occurrence and remove all other header rows. header for file 1111 2222 3333 header for file 1111 2222 3333 header for file... (8 Replies)
Discussion started by: gary_w
8 Replies

3. UNIX for Dummies Questions & Answers

Matching and reporting near-similar lines in a file

Hi, I have a file with the lines as below: C_10_A05_T7 C_10_A06_SP6 C_10_B05_SP6 C_10_B05_T7 C_10_B01_SP6 C_10_B01_T7 C_12_G07_SP6 C_12_G11_SP6 C_12_G11_T7 C_2_H18_T7 C_2_I02_SP6 C_2_I02_T7 C_2_I13_SP6 C_2_I17_SP6 The four segments of each line are connected by '_' symbols. I... (7 Replies)
Discussion started by: Fahmida
7 Replies

4. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

5. 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

6. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies

7. 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

8. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies

9. Shell Programming and Scripting

How to delete all lines before a particular pattern when the pattern is defined in a variable?

I have a file Line 1 a Line 22 Line 33 Line 1 b Line 22 Line 1 c Line 4 Line 5 I want to delete all lines before last occurrence of a line which contains something which is defined in a variable. Say a variable var contains 'Line 1', then I need the following in the output. ... (21 Replies)
Discussion started by: Soham
21 Replies

10. Shell Programming and Scripting

[sed] Finding and sticking the pattern to the beginning of successive lines up to the next pattern

I have a file like below. 2018.07.01, Sunday 09:27 some text 123456789 0 21 0.06 0.07 0.00 2018.07.02, Monday 09:31 some text 123456789 1 41 0.26 0.32 0.00 09:39 some text 456789012 1 0.07 0.09 0.09 09:45 some text 932469494 1 55 0.29 0.36 0.00 16:49 some text 123456789 0 48 0.12 0.15 0.00... (9 Replies)
Discussion started by: father_7
9 Replies
Graph::Easy::Edge(3pm)					User Contributed Perl Documentation				    Graph::Easy::Edge(3pm)

NAME
Graph::Easy::Edge - An edge (a path connecting one ore more nodes) SYNOPSIS
use Graph::Easy; my $ssl = Graph::Easy::Edge->new( label => 'encrypted connection', style => 'solid', ); $ssl->set_attribute('color', 'red'); my $src = Graph::Easy::Node->new('source'); my $dst = Graph::Easy::Node->new('destination'); $graph = Graph::Easy->new(); $graph->add_edge($src, $dst, $ssl); print $graph->as_ascii(); DESCRIPTION
A "Graph::Easy::Edge" represents an edge between two (or more) nodes in a simple graph. Each edge has a direction (from source to destination, or back and forth), plus a style (line width and style), colors etc. It can also have a label, e.g. a text associated with it. During the layout phase, each edge also contains a list of path-elements (also called cells), which make up the path from source to destination. METHODS
error() $last_error = $edge->error(); $cvt->error($error); # set new messags $cvt->error(''); # clear error Returns the last error message, or '' for no error. as_ascii() my $ascii = $edge->as_ascii(); Returns the edge as a little ascii representation. as_txt() my $txt = $edge->as_txt(); Returns the edge as a little Graph::Easy textual representation. label() my $label = $edge->label(); Returns the label (also known as 'name') of the edge. name() my $label = $edge->name(); To make the interface more consistent, the "name()" method of an edge can also be called, and it will returned either the edge label, or the empty string if the edge doesn't have a label. style() my $style = $edge->style(); Returns the style of the edge, like 'solid', 'dotted', 'double', etc. nodes() my @nodes = $edge->nodes(); Returns the source and target node that this edges connects as objects. bidirectional() $edge->bidirectional(1); if ($edge->bidirectional()) { } Returns true if the edge is bidirectional, aka has arrow heads on both ends. An optional parameter will set the bidirectional status of the edge. undirected() $edge->undirected(1); if ($edge->undirected()) { } Returns true if the edge is undirected, aka has now arrow at all. An optional parameter will set the undirected status of the edge. has_ports() if ($edge->has_ports()) { ... } Return true if the edge has restriction on the starting or ending port, e.g. either the "start" or "end" attribute is set on this edge. start_port() my $port = $edge->start_port(); Return undef if the edge does not have a fixed start port, otherwise returns the port as "side, number", for example "south, 0". end_port() my $port = $edge->end_port(); Return undef if the edge does not have a fixed end port, otherwise returns the port as "side, number", for example "south, 0". from() my $from = $edge->from(); Returns the node that this edge starts at. See also "to()". to() my $to = $edge->to(); Returns the node that this edge leads to. See also "from()". start_at() $edge->start_at($other); my $other = $edge->start_at('some node'); Set the edge's start point to the given node. If given a node name, will add that node to the graph first. Returns the new edge start point node. end_at() $edge->end_at($other); my $other = $edge->end_at('some other node'); Set the edge's end point to the given node. If given a node name, will add that node to the graph first. Returns the new edge end point node. flip() $edge->flip(); Swaps the "start" and "end" nodes on this edge, e.g. reverses the direction of the edge. flow() my $flow = $edge->flow(); Returns the flow for this edge, honoring inheritance. An edge without a specific flow set will inherit the flow from the node it comes from. edge_flow() my $flow = $edge->edge_flow(); Returns the flow for this edge, or undef if it has none set on either the object itself or its class. port() my ($side, $number) = $edge->port('start'); my ($side, $number) = $edge->port('end'); Return the side and port number where this edge starts or ends. Returns undef for $side if the edge has no port restriction. The returned side will be one absolute direction of "east", "west", "north" or "south", depending on the port restriction and flow at that edge. get_attributes() my $att = $object->get_attributes(); Return all effective attributes on this object (graph/node/group/edge) as an anonymous hash ref. This respects inheritance and default values. See also raw_attributes(). raw_attributes() my $att = $object->get_attributes(); Return all set attributes on this object (graph/node/group/edge) as an anonymous hash ref. This respects inheritance, but does not include default values for unset attributes. See also get_attributes(). attribute related methods You can call all the various attribute related methods like "set_attribute()", "get_attribute()", etc. on an edge, too. For example: $edge->set_attribute('label', 'by train'); my $attr = $edge->get_attributes(); my $raw_attr = $edge->raw_attributes(); You can find more documentation in Graph::Easy. EXPORT
None by default. SEE ALSO
Graph::Easy. AUTHOR
Copyright (C) 2004 - 2008 by Tels <http://bloodgate.com>. See the LICENSE file for more details. perl v5.14.2 2011-12-23 Graph::Easy::Edge(3pm)
All times are GMT -4. The time now is 07:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy