parse_file convenience function