The UNIX and Linux Forums  

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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Loop till you find a string in a fine <-- Need Help New to Unix Scripting mrehman UNIX for Dummies Questions & Answers 1 01-30-2008 02:01 PM
Anyways to find sentences with data format and extract it??? cyberray Shell Programming and Scripting 4 10-30-2007 07:22 PM
Search term and output term in desired field Raynon Shell Programming and Scripting 28 03-03-2007 10:34 PM
Create a Term & Run chars on this Term the_tical High Level Programming 1 08-12-2003 06:18 PM
extract data from a find string odogbolu98 Shell Programming and Scripting 2 05-15-2002 05:06 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-16-2007
Registered User
 

Join Date: Sep 2006
Location: Sg
Posts: 307
Find term and extract till end of data

Hi All,

I have an awk code below. How can i edit it such that once it finds the term "start" , it will extract all the rest of data thereafter ?

awk '/start/, /stop/' file
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-16-2007
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,226
Try..
Code:
awk '/start/, 0' file
Reply With Quote
  #3 (permalink)  
Old 04-16-2007
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Code:
sed -n "/start/,$ p" file
Reply With Quote
  #4 (permalink)  
Old 04-16-2007
dj -------
 

Join Date: Feb 2007
Location: Cochin, India
Posts: 332
Code:
awk '/start/,/NR/' filename
Reply With Quote
  #5 (permalink)  
Old 04-16-2007
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,226
Quote:
Originally Posted by jacoden
Code:
awk '/start/,/NR/' filename
umm... that code would print lines from where the line contains "start" until the line contains "NR".
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0