writing parser output to a file