On Tue, Nov 23, 2010 at 5:52 PM, Phani Bhushan Tholeti <[email protected]>wrote:

> >> if you are looking for a regex. that elas with only one line at a
> >> time: <string1>(.*)<string2>
> >
> > I was looking for this - http://www.cyberciti.biz/faq/sed-display-text/
> > This post has solve my huge problems.
>
> Didn't know sed had a start-stop pair implementation, but then I don;t
> know any much of sed either, or maybe I haven't read the awk manual
> properly ;)
>
> Good info, all the same. Will try to file in my head.
>
> --
> Lots o' Luv,
> Phani Bhushan
>
> Let not your sense of morals prevent you from doing what is right -
> Isaac Asimov (Salvor Hardin in Foundation and Empire)
>
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.gnu.org/philosophy/no-word-attachments.html
>
> --
> l...@iitd - http://tinyurl.com/ycueutm
>

Here is the Algo -

Read File
get all character from File into array
Get word1  #length l1
Get word2   #length l2
Set offsetw1 = 0

Label s1
IF ( read first l1 characters from array start from offset. and does it
match with word1 ?)
{
Yes --
      Set Offsetw2 = offsetw1 + l1
       label s2
       IF ( read first l2 characters from array start from offsetw2. and
does it match with word2 ? )
        {
            StdOut all the character found between match of w1 and w2
            go to Label S1
         }
         else{
           increase offsetw2++
           go to Label s2
        }

 }else{

     increase offsetw1++
     Go to Label s1
}

-- 
┌─────────────────────────┐
│    Narendra Sisodiya
│    http://narendrasisodiya.com
└─────────────────────────┘

-- 
l...@iitd - http://tinyurl.com/ycueutm

Reply via email to