For me your array is backwards on how I usually do it but if it was reversed this is how I would do it. Also we don't know the size of the second array and if the line is being pushed to empty or already populated so you can use the width, or in your case height.
Push arraywords.at(loopindex,0) to arrayresult
Arrayresult set at x,y , x=arrayresult.width-1,y=1,value=arraywords.at(loopindex,1)
Arrayresult set at x,y , x=arrayresult.width-1,y=2,value=arraywords.at(loopindex,2)
etc
I guess reverse x,y for how your array is set up and use height.