Search and replace particular characters in fixed length-file

Masters,
I have fixed length input file like

FHEAD0000000001XXXX20090901      0000009000Y1000XXX2
THEAD000000000220090901      ITM0000109393813            430143504352N22SP    000000000000RN000000010000EA  P0000000000000014390020090901      
TTAIL0000000003000000
FTAIL00000000040000000002

Note the fields in Bold Italicized.. These fields need to be replaced with variable in shell script( of same format YYYYMMDD ). I used cut command, but it is trimming the spaces between the fields.
How to I achieve this field replacement, without changing the length/ format of the file

---------- Post updated at 03:08 PM ---------- Previous update was at 03:07 PM ----------

Forogt to mention that I have to change only in FHEAD and THEAD records only in those positions.

while IFS= read -r line
do
    case "$line" in
        FHEAD*) echo "${line:0:19}$(date +%Y%m%d)${line:27}";;
        THEAD*) echo "${line:0:15}$(date +%Y%m%d)${line:23}";;
        *) echo "$line";;
    esac
done <"file"

With awk:

awk -v var="$(date +%Y%m%d)" '
/^FHEAD/{print substr($0,1,19) var substr($0,28); next}
/^THEAD/{print substr($0,1,15) var substr($0,24,106) var substr($0,138); next}
1' file > newfile
$ d="20091128"

$ echo $d
20091128

$ sed "s/\([FT]HEAD[0-9a-zA-Z]*\)[0-9]\{8\}/\1$d/g" urfile

Shorter

sed "s/\([FT]HEAD\S*\)[0-9]\{8\}/\1$d/g" urfile

thanx guys..tried awk command and working the way i want....will try other commands too...