LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Closed Thread
 
Search this Thread
Old 11-22-2009, 05:53 AM   #1
rattlesnakejoe
LQ Newbie
 
Registered: Oct 2008
Posts: 14

Rep: Reputation: 0
grep till second pattern


Hi...

I want the lines upto the second occurance of a pattern to be printed.... i
know only till the first occurance....

i use awk '/pattern1/,/pattern2/' file

or sed -n '/pat1/,/pat2/p' file

I want all the lines from the start of the file till the second occurance of pattern called "Score"

Thanks
 
Old 11-22-2009, 08:09 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
grep exact pattern kapila Linux - Newbie 11 08-06-2009 02:58 AM
grep lines between occurances of a pattern ksri07091983 Solaris / OpenSolaris 5 04-26-2009 06:14 AM
grep till the 1st occurrence of a pattern raghu123 Programming 2 04-15-2009 05:47 AM
grep till the 1st occurrence of a pattern raghu123 Programming 1 04-15-2009 05:17 AM
using grep when the pattern contains a ! farmerjoe Programming 9 03-15-2005 11:04 PM


All times are GMT -5. The time now is 07:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration