reverse strings in a file