Why not close the file, then open it again, read what's in it into an array/string, and then print it?