![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
man awk.
awk '/^*****************/, /^******************/ { ... more stuff ... }' |
|
#3
|
||||
|
||||
|
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
|
||||
| Google The UNIX and Linux Forums |