process file and print messages