Sponsored Content
Top Forums Shell Programming and Scripting How to print all the lines after pattern matching? Post 302669593 by ankitknit on Wednesday 11th of July 2012 05:53:36 AM
Old 07-11-2012
Yeah thanks !! i got it what i really wanted ....
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print block of lines matching a pattern

Hi :), I am using the script to search "MYPATTERN" in MYFILE and print that block of lines containing the pattern starting with HEADER upto FOOTER. But my problem is that at some occurrence my footer is different e.g. ";". How to modify the script so that MYPATTERN between HEADER and different... (1 Reply)
Discussion started by: vanand420
1 Replies

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

3. Shell Programming and Scripting

I want to print next 3 lines after pattern matching.

Dear Experts, I have file called file1 in which i am greping a pattern after that i want to next 3 lines when that pattern is matched. Ex:- file1 USA UK India Africa Hello Asia Europe Australia Hello Peter Robert Jo i want to next 3 lines after matching Hello... (12 Replies)
Discussion started by: naree
12 Replies

4. Shell Programming and Scripting

Script on pattern matching and print lines and export to excel

Hi Friends, I am working on a script.. Looking forward for your expert help..... My requirement is: I have a text file where, need to search equip * RTF or end of line with RTF ,once this pattern is found then print 2nd line, 6th line, 7th line to a different file. For Ex: equip 1... (34 Replies)
Discussion started by: shaliniyadav
34 Replies

5. Shell Programming and Scripting

print range of lines matching pattern and previous line

Hi all, on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern. the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/' I need to include the... (1 Reply)
Discussion started by: siriche
1 Replies

6. Shell Programming and Scripting

Compare file1 for matching line in file2 and print the difference in matching lines

Hello, I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies

7. Shell Programming and Scripting

Want to print out lines with a matching pattern from file

Hi all, I want to search for strings in file1 that can be found in file2 and print out the whole line when matching pattern is found. I have used the below command, but this is not working for me, because it is writing out only the matching patterns from file2, not the whole line. fgrep -o... (2 Replies)
Discussion started by: MonikaB
2 Replies

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

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

10. Shell Programming and Scripting

Print lines after matching two pattern

would like to print everything after matching two patterns AAA and BBB. output : CCC ZZZ sample data : AAA BBB CCC ZZZ (4 Replies)
Discussion started by: jhonnyrip
4 Replies
VOP_READDIR(9)						   BSD Kernel Developer's Manual					    VOP_READDIR(9)

NAME
VOP_READDIR -- read contents of a directory SYNOPSIS
#include <sys/param.h> #include <sys/dirent.h> #include <sys/vnode.h> int VOP_READDIR(struct vnode *vp, struct uio *uio, struct ucred *cred, int *eofflag, int *ncookies, u_long **cookies); DESCRIPTION
Read directory entries. vp The vnode of the directory. uio Where to read the directory contents. cred The caller's credentials. eofflag Return end of file status (NULL if not wanted). ncookies Number of directory cookies generated for NFS (NULL if not wanted). cookies Directory seek cookies generated for NFS (NULL if not wanted). The directory contents are read into struct dirent structures. If the on-disc data structures differ from this then they should be trans- lated. LOCKS
The directory should be locked on entry and will still be locked on exit. RETURN VALUES
Zero is returned on success, otherwise an error code is returned. If this is called from the NFS server, the extra arguments eofflag, ncookies and cookies are given. The value of *eofflag should be set to TRUE if the end of the directory is reached while reading. The directory seek cookies are returned to the NFS client and may be used later to restart a directory read part way through the directory. There should be one cookie returned per directory entry. The value of the cookie should be the offset within the directory where the on-disc version of the appropriate directory entry starts. Memory for the cookies should be allocated using: ...; *ncookies = number of entries read; *cookies = malloc(*ncookies * sizeof(u_long), M_TEMP, M_WAITOK); ERRORS
[EINVAL] An attempt was made to read from an illegal offset in the directory. [EIO] A read error occurred while reading the directory. SEE ALSO
vnode(9) AUTHORS
This manual page was written by Doug Rabson. BSD
July 24, 1996 BSD
All times are GMT -4. The time now is 01:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy