Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Print lines between the search pattern Post 302261335 by prsshini on Monday 24th of November 2008 12:24:59 PM
Old 11-24-2008
its the otherway

Hi
I m sorry for not being clear.. Its like
I want line from XXX till the line before next xxx..
say if
xxx
1
2
3
4
xxx,
i want the lines from first xxx till line4.
Could you please help. Thanks a lot.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search file for pattern and grab some lines before pattern

I want to search a file for a string and then if the string is found I need the line that the string is on - but also the previous two lines from the file (that the pattern will not be found in) This is on solaris Can you help? (2 Replies)
Discussion started by: frustrated1
2 Replies

2. Shell Programming and Scripting

Search for a pattern in a file and print previous lines from a particular point

Hi, I am new to ksh scripting and I have a problem. I have a file in which I have to search for a particular pattern say 'a' then from that line I need to search for another pattern say 'b' in the previous lines and thne print the file from pattern 'b' till the end of file. For eg: ... (2 Replies)
Discussion started by: umaislearning
2 Replies

3. Shell Programming and Scripting

Search for Pattern and Print including Lines in between

Gurus, I have a big file that needs to be sorted out and I cant figure out what to do. The file name is as below: Name: xxxx yyyy nnnn Description: dfffgs sdgsgsf hsfhhs afgghhjdgj fjklllll gsfhfh Updated: jafgadsgg gsg Corrected: date today The file consists of line like these. ... (13 Replies)
Discussion started by: The One
13 Replies

4. Shell Programming and Scripting

Print a pattern between the xml tags based on a search pattern

Hi all, I am trying to extract the values ( text between the xml tags) based on the Order Number. here is the sample input <?xml version="1.0" encoding="UTF-8"?> <NJCustomer> <Header> <MessageIdentifier>Y504173382</MessageIdentifier> ... (13 Replies)
Discussion started by: oky
13 Replies

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

6. Shell Programming and Scripting

Search pattern on logfile and search for day/dates and skip duplicate lines if any

Hi, I've written a script to search for an Oracle ORA- error on a log file, print that line and the .trc file associated with it as well as the dateline of when I assumed the error occured. In most it is the first dateline previous to the error. Unfortunately, this is not a fool proof script.... (2 Replies)
Discussion started by: newbie_01
2 Replies

7. Shell Programming and Scripting

Search Pattern and Print lines in Single Column

Hi Experts I have small query where I request the into a single file Suppose: File1: {Unique entries} AA BB CC DD FileB: AA, 123 AA, 234 AA, 2345 CC, 123 CC, 5678 DD,123 BB, 7890 (5 Replies)
Discussion started by: navkanwal
5 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. 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
IMGREP(1p)						     Internet Message commands							IMGREP(1p)

NAME
imgrep - search for mail/news messages SYNOPSIS
imgrep [OPTIONS] [FOLDER] [RANGE] DESCRIPTION
The imgrep command enumerates mail/news messages matched given patterns. This command is provided by IM (Internet Message). OPTIONS
-s, --src=FOLDER,FOLDER... message source: "+folder:[range[,range..]]". "--src=+xxx" is equivalent to "+xxx". -f, --format=STRING Output format: "number", "folder", or "path". (default: "number" for single target folder, "path" for multiple target folders) -c, --casefold={on,off} Case sensitivity. (This option affects both fieldname and pattern.) Default value is "on". -e, --expression=STRING Search expression: Usable keyword & && logical AND | || logical OR ! logical NOT ( ) parens fieldname=pattern search pattern for the field Special fieldname: head Entire header body Entire body all Entire message -d, --delimiter=STRING Mail header delimiter. Default value is " | ---- ". -D, --dupchecktarget=STRING Duplicate check target ('none', 'message-id', or 'message-id+subject'). Default value is 'none'. -q, --quiet={on,off} Do not show any messages. -v, --verbose={on,off} Print verbose messages when running. --debug=DEBUG_OPTION Print debug messages when running. -h, --help Display help message and exit. --version Output version information and exit. COPYRIGHT
IM (Internet Message) is copyrighted by IM developing team. You can redistribute it and/or modify it under the modified BSD license. See the copyright file for more details. IM151 2011-05-25 IMGREP(1p)
All times are GMT -4. The time now is 06:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy