Parsing text file

I'm totally stumped with how to handle this huge text file I'm trying to deal with. I really need some help!
Here is what is looks like:

ab1ba67c331a3d731396322fad8dd71a3b627f89359827697645c806091c40b9
0.2
812a3c3684310045f1cb3157bf5eebc4379804e98c82b56f3944564e7bf5dab5
0.6
0.6
9b27f7f2b07eb11e9576792d1105c3e43377c2659d18f0ac6ae894a2a548080e
0.1

It's pretty much hashes with values underneath each hash. It's quite large.

What I'm try to do is add all the numbers under each hash so the second one would be 1.2.

I also need a unique hash for each 0.2 value. So the first one would stay the same. The second one should have a total of six hashes. So the script would take the original hash and add a "1" and the end then sha256sum hash it again. (eg. sha256(812a3c3684310045f1cb3157bf5eebc4379804e98c82b56f3944564e7bf5dab51) Then take off the "1" add a "2" and all the way to "5". So in the end there would be 6 hashes under each other with 1.2 underneath.

Since the last hash has 0.1 it would add a "BAD AMOUNT" after the 0.1.

If the amount was 1.1 it would only make 5 hashes for the amount and add "EXTRA AMOUNT".

I've tried for days figuring it out but I can't. Any help would be appreciated!! THANK YOU!

please post the code you have been working on.

Also you should post desired output for this sample data.

I'm trying to teach myself scripting as I'm doing it. I KNOW I'm probably not even close! :frowning:

#!/bin/bash

for (( i = 1; i <= 10; i++ ))
do

linedata=`sed -n $i'p' ./exp.txt`
length=${#linedata}

if [ $length = 64 ]
then
echo $linedata
fi

total=0.0

while [ $length -ne 64 ]
do
total=$(echo "scale=9; $total+$linedata" | bc )
i=$(($i + 1))
linedata=`sed -n $i'p' ./exp.txt`
length=${#linedata}
done
echo $total

---------- Post updated at 04:39 PM ---------- Previous update was at 04:36 PM ----------

Eg output.

ab1ba67c331a3d731396322fad8dd71a3b627f89359827697645c806091c40b9
0.3 EXTRA
812a3c3684310045f1cb3157bf5eebc4379804e98c82b56f3944564e7bf5dab5
08e78bac1d7f4aff0daf79c77abf33dfe2b8d953e4807ad47a4212db147fd6bd
ed84fea7b54d62fd87fabc5ed6a02d96e2886db9c48e3b54d8b69e73cc91d76e
c566b1f5e12ac452886b4de5477dad191786866567957d9a3e40997e68301b11
cbb348256408a106c2f6329938d430f3748757dc0771a6f956d909e6675a4a5c
cf59c0735d7154ace594b97918c4dacbc6a4caa82d07d5cd973d7531a0955b1b
1.2
9b27f7f2b07eb11e9576792d1105c3e43377c2659d18f0ac6ae894a2a548080e
0.1 BAD AMOUNT