The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 11-24-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,322
Quote:
Originally Posted by prsshini View Post
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.
Try this:

Code:
awk 'p && /xxx/{exit} /xxx/{p=1}p' file