Reads a file of records, sorts them, and then writes them back to another file.