Sponsored Content
Operating Systems AIX Grep a pattern and print following n lines Post 302934283 by ssk250 on Thursday 5th of February 2015 11:34:37 PM
Old 02-06-2015
Hi All,

Thanks All. The below script worked for me

Code:
/usr/xpg4/bin/awk '$0 ~ PAT { N=LINES } (N--) > 0' LINES=5 PAT="ISEND" sqloutput1.log

Just want to know... In a similar way how the lines before this pattern can be printed.

Last edited by ssk250; 02-06-2015 at 12:37 AM.. Reason: Need to add another point
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print certain pattern from 2 lines

i have 2 lines comming out of a script o/p.below the line. 2008-10-14 05:47:05,551 INFO - LPBatch: 2008-10-14 05:47:05,575 INFO - Number of Intervals Not Inserted: 1 / 95 -------------------------------------------------------------------------- How to print the below o/p from the... (2 Replies)
Discussion started by: ali560045
2 Replies

2. Shell Programming and Scripting

AIX equivalent to GNU grep's -B and -A [print lines after or before matching lines]

Hi folks I am not allowed to install GNU grep on AIX. Here my code excerpt: grep_fatal () { /usr/sfw/bin/gegrep -B4 -A2 "FATAL|QUEUE|SIGHUP" } Howto the same on AIX based machine? from manual GNU grep ‘--after-context=num’ Print num lines of trailing context after... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

3. Shell Programming and Scripting

Print lines between two lines after grep for a text string

I have several very large file that are extracts from Oracle tables. These files are formatted in XML type syntax with multiple entries like: <ROW> some information more information </ROW> I want to grep for some words, then print all lines between <ROW> AND </ROW>. Can this be done with AWK?... (7 Replies)
Discussion started by: jbruce
7 Replies

4. Shell Programming and Scripting

Print the above and below lines for the grep pattern.

Hi, i would like to get the above and below lines of the grep pattern . For ex : file as below: chk1- aaaa 1-Nov chk2 -aaaa ########## chk1-bbbbbb 1-Nov chk2-bbbbbb ######### my search pattern is date : 1-Nov i need the o/p as below chk1- aaaa 1-Nov (6 Replies)
Discussion started by: expert
6 Replies

5. Shell Programming and Scripting

print lines up to pattern excluding pattern

11 22 33 44 55 66 77 When pattern 55 is met, print upto it, so output is 11 22 33 44 (1 Reply)
Discussion started by: anilcliff
1 Replies

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

7. Shell Programming and Scripting

How to print the lines between the pattern using awk/grep/sed?

Hi, I need a help to search a pattern and print the multiple lines between them. Input file: Tue May 29 12:30:33 EDT 2012:threadWebContainer : 357:com.travimp.hotelierlinks.abba.service.RequestHandler.requestService(String, ITICSDataSet): hotelCancelReservation request: ... (4 Replies)
Discussion started by: aroragaurav.84
4 Replies

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

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

10. 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
LIBPAT(3)						     cao-vlsi reference manual							 LIBPAT(3)

ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr NAME
PAT - Generic pattern data structure DESCRIPTION
PAT is a generic data structure supporting vlsi concepts. It allows representation of a sequence of simulation patterns in a data struc- ture. The goal of PAT is to define an ad hoc single data structure (object), with well known fixed meaning for each concept manipulated in pat- tern description. So any tools that needs to access simulation patterns can be build upon it, using these structures. For each object (data structure), a set of functions has been defined in order to add, delete or access it. These functions are defined in a low-level library libPat106.a. Some other functions are higher level. They are defined in a high-level library libPhl106.a. There are also some parsers-drivers. A parser reads a pattern description file in a given format and build up a complete PAT data base. A driver creates a text file in a given format from a PAT data base. A pat format parser-driver is available in the libPpt106.a library. Pattern description envolves the following notions (for further details see pat(5)): input port controlled by the user output signal or port observed by the user initialization forcing the value of a register pattern sequence list of values to be forced on inputs or to be checked as the result of the simulation on outputs The input-output list is represented by two data structures: pagrp contains informations relative to actual or virtual arraies and, paiol represents a one-bit input-output. Both are simply chained lists. However, to make a more efficient access to paiol structures, they are organized in a table. So, a paiol can also be addressed using an offset. Another group of data structures is used to represent a pattern. paini contains values to be forced into registers before processing the pattern. An event (a modification of value) on an input-output is given by a paevt structure. A third structure, papat gathers all infor- mation concerning a pattern (including initializations - paini - and events - paevt). A pacom is used to represent a comment. Finally, all these structures can be accessed through a unique structure, paseq, designed to represent a complete sequence of simulation patterns. ORGANIZATION
In order to use PAT, concepts on use of libraries are needed. And, since these libraries are under development, the code is subject to change. To enable work, a static version of each library is always present for the user. Libraries and header files are suffixed by a number (the library's version). The programmer can prefer to work with an earlier version of a library rather than the most recent one. However, it is recommended to adapt softwares to libraries as soon as possible in order to spotlight potential compatibility problems before old libraries are removed. A makefile is necessary for all PAT applications. This is required because any soft must be easily recompilable, and knowing the needed libraries for a PAT based program is not an easy matter. It can't be achieved by an other way, so do use makefile. In terms of software organization, PAT is splitted into two libraries for the basic functions, a header file for structures and variable declarations and, up to now, one parser-driver library for pat format. It is to be noticed that library's version number is incremented when, at least, one function composing the library has been modified. Therefore, PAT libraries may evolve independently form each other. Here follows the list of the libraries and their contents. libPat106.a: pat_addpaseq, pat_addpagrp, pat_addpaiol, pat_addpapat, pat_addpaevt, pat_addpaini, pat_addpacom, pat_frepaini, pat_frepaiol, pat_frepacom, pat_frepapat, pat_frepaevt, pat_crtpaiol libPhl106.a: pat_debug, pat_getcount libPpt106.a: pat_lodpaseq, pat_savpaseq, pat_drvpat, pat_prspat The libraries are organized in such a way that no cycle can appear through calls. It means that, if in a given library a function calls another function in another library, then none of the functions of this one does call any function that belongs to the first library. EXAMPLE
In order to use PAT libraries, one needs something like this in its makefile: HEADER = -I/labo/include LIB = -L/labo/lib -lPat106 -lPhl106 -lPpt106 -lMut315 SEE ALSO
mbk(1), pat(5) BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 LIBPAT(3)
All times are GMT -4. The time now is 03:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy