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
find a string and get the next string sbandla Shell Programming and Scripting 3 04-17-2008 05:21 PM
to find numbers in a string fongthai Shell Programming and Scripting 12 11-22-2007 01:34 PM
find string in .jar file rakeshou UNIX for Dummies Questions & Answers 8 07-06-2007 12:42 PM
how to find and replace string mridula High Level Programming 3 08-17-2006 01:44 AM
python and string.find penguin-friend Shell Programming and Scripting 0 06-07-2006 06:40 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-27-2005
Registered User
 

Join Date: Aug 2005
Posts: 23
How to find the string in between

I have a file as follows

******************************************
cccccccccc

aaaaaaaaaa

bbbbbbbbbb

cccccccccc

dddddddddd

cccccccccc
******************************************


I want to search for "cccccccc" which exists between "bbbbbbbb" and "dddddddd."

Can someone through me a hint/thought .

Thanks
Srini
Reply With Quote
Forum Sponsor
  #2  
Old 10-27-2005
Registered User
 

Join Date: Jan 2005
Posts: 682
man awk.

awk '/^*****************/, /^******************/ { ... more stuff ... }'
Reply With Quote
  #3  
Old 10-27-2005
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
Perhaps try something like this...
Code:
while read line
do
    case $line in
        *bbbbbbbb*) flag=1 ;;
        *dddddddd*) flag=0 ;;
        *cccccccc*) [[ $flag -eq 1 ]] && echo "Found this --> $line" ;;
    esac
done < file1
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:13 AM.


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

Content Relevant URLs by vBSEO 3.2.0