Don't read it twice. Save the result in a data structure.
Would a String be sufficient? Then create a Scanner using the String
to "re-read" in the MIPS assembly language? Or would it be better to
use an ArrayList or Hashtable?
A string scanner would work, but beware string concatenation in
building the string. x + y takes time proportional to the length
of x.
It is probably better to use ArrayList as you suggest.