Firstly, utilising the [ code ][ \code ] delimeters (without the spaces) will make your code much more readable.
Second, perhaps if you gave us a demo of what is in the file, ie the large numbers, and the goal of the script we may be able to help more?
Lastly, a little consistency would really help with trying to understand your code: (for example)
First post -
Yet you then pull the 'j' variable out of nowhere
From both your posts -
Code:
(( T++ ))
# and then later
let k=$k+1
Again these are the same task, to increase variable by 1, but done in different ways.
Just a thought