$> sed 's/^PACK:[ \t]*\(.*\)UNPACK.*/\1/g' infile
P42 77
$> sed 's/.*UNPACK:[ \t]*\(.\{,20\}\).*/\1/g' infile
MHTT DMK
You have 104 posts already and still don't use code tags. Please edit your post accordingly as commented by radoulov. If have problems using code tags, let us know, ty.
here everything is variable in length except words READY:, PACK: and UNPACK:
We want to send anything appearing between word PACK: and UNPACK: to op.txt
Similarly next 20 characters of word UNPACK: