script to extract survey data