Writing a text-formatted record