let's say your file looks like this;
.
.
.
aa
bb
cc
dd
ee
ff
gg
hh
ii
jj
kk
.
.
and let's say your string is gg
do you want to remove bb-ii (including bb,gg,ii) ? if it is;
currentline=`grep -n string inputfile|awk ' {print $1} '`
let "startingline=$currentline-5"
let "finishingline=$currentline+2"
sed -n "$startingline,${finishingline}!s/.*/&/p" inputfile>outfile