It looks too busy as well as things like "if [ $myline = *Hi* ] && [[ ! $myline = *record* ]]" do not seem to be stable or fire for your line. Maybe use case, which I like for its form and extensibility, although there are many other ksh93 ways to test strings. {} not needed. No examples of the other lines you need to worry about for some reason. All ksh, no fork/exec costs.
TEXT=
while read l
do
case "$l" in
("Hi = "[0-9][0-9])
TEXT="$TEXT ${l#*= }"
;;
esac
done < test.dat
echo "${TEXT# }"
Thank you guys for the amazing replies. They work.
I am going to go ahead and use zaxxon's way, as it kind of fits in what i actually want to do (this was just a snippet of what i actually intend to do), so special thanks to him