I have a set of options in the form of key value in a file. Need to find a particular value of 'a' and delete all lines till the next 'a' keyword .
Ex :
a bbb
c ddd
e fff
g hhh
a sss
c ggg
e xxx
f sss
a ddd
d sss
r sss
g hhh
and so forth
Here 'a' keyword is present in each stanza. I need to parse to find a particular value of 'a' (let's say 'sss') and from there, delete all lines till the next 'a' keyword.
Ranjith - Can you please explain your command below...
Let's assume I found the line with "a sss" using grep... all I now need to do is start deleting lines till I find the next keyword "a ..." (... can be any value)
Hope that gives better picture.
It's kind of
(while nextkeyword != 'a')
{
delete all lines inbetween
}