help with finding a string

Hello folks

I have a text file abcd.txt and has a line starting with number '8'.

I have a string in this line starting at position 'a' to position 'b'
also this string is a number and have to be reduced by 1. there is also a problem that it has to be padded with zeros to make the string always with 6 characters.

eg: abcd.txt

content of this file:

1ahdhliehgoei
5abldflierjlijuero903489 034309842098
8000000020809832021090-34

the third line starting with 8 has to be changed. the string starts at position 4 to position 9.

so 000002 has to be reduced by 1 and shown as 000001

and the output should look like this in the same abcd.txt file.

1ahdhliehgoei
5abldflierjlijuero903489 034309842098
8000000010809832021090-34

how can this be changed in shell scripting

I would appreciate if someone can help me on this.

Thanks in advance....

try to code up something first nex time

awk '/^8/{ 
          tochange=substr($0,4,6)
          printf "%s%06s%s\n", substr($0,0,3), tochange-1 ,substr($0,9)          
          }
     !/^8/{print}
' "file"

Thank You... you're awesome...