If you want to store the values in a human-friendly format (since you are using text file, I assume that) the you may write 'verbosely' each item, e.g.
a[0][0] = 5
a[0][1] = 7
..
a[1][0] = 27
a[1][1] = -7
..
(see
How to: Write to a Text File[
^]).
On the other hand, if you need to store the array for later retrieval in you program then you may prefer
serialization[
^].