A function to parse values in a buffer to file