- parse file function