Writes and reads rational matrices to and from text files