I am tring to extract text from a multi-line file. For example I need to extract all text from "Section 1.0" to "Section 3.0"
This can be on many lines.
I have code that works, but seems clumsy and slow. Is there a better way to do this? sed? reg expression?
flag="false"
for line in ${textFile};
do
if [ "$line" == "Section 3.0" ]; then
flag="false"
fi
if [ "$flag" == "true" ]; then
temp_var+=$line
fi
if [ "$line" == "Section 1.0" ]; then
flag="true"
fi
done