I think you should format the whole text to a Dictionary. With 3 str variables. WholeText, TempText, NextText.
once > Set NextText to WholeText
While NextText is not ""
Set TempText to NextText
Variable 'place' = 0
For "index" from 39 to 0
if mid(TempText , loopindex("index"), 1) = " " > break loop
> set place to loopindex("index")
add key to dictonary .. key = str(some counter) .. value = left(TempText,place - 1)
Set NextText to right(TempText, len(TempText) - place)
(you might have to place -1 or + 1, not sure)
Store the .jason, could be handy.
Something like that.
Then you have it all handy. Reading from from the dictonary goes like:
the expression : Dictionary.Get(str(some counter))