Saving an array on a simple .dat file

Hello,
I have, for example, an array like this: x[3][2], with contents:
123
456
and I would like to save it on a file, say, array.dat, in a way that, when I open it, it is in the right order
123
456
and not like
1
2
3
4
5
6
How can I do?
Thank you very much!
Elena