The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
need help cutting consecutive lines with sed or awk raghin Shell Programming and Scripting 2 06-04-2008 04:59 AM
How to grab the value of field before the line reached ahjiefreak Shell Programming and Scripting 3 03-28-2008 05:59 AM
grab the line using awk cdfd123 Shell Programming and Scripting 1 10-10-2007 08:21 AM
Appending Consecutive lines pondlife Shell Programming and Scripting 8 08-13-2004 05:36 AM
Cutting n consecutive lines from a file... Vishnu UNIX for Dummies Questions & Answers 2 10-18-2002 10:49 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-07-2006
wisher115 wisher115 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 18
grab next consecutive line or lines

Hello i'm writting a krn shell that will find the letter F and I would like to grab everything from F till 0:00. Is there a sed or awk command that i could use.
Thank you. File is looks like this.

11/12 xxx xxxx xxx F xxxx xxxx
some info entered here
some info entered here
xxxx 0:00 xxxx xxx S xxxx xxxx
11/12 xxx xxxx xxx F xxxx xxxx
some info entered here
some info entered here
xxxx 0:00 xxxx xxx S xxxx xxxx

All the x's have data that changes and " some info entered here" can be either 1 or more lines. Plus the whole info repeats so i would just like to capture the first occurance of it. Thanks.

  #2 (permalink)  
Old 12-07-2006
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Code:
sed -n "/F/,/0:00/{p;/0:00/q;}" file
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0