Outputting measurements into a CSV file