Script to generate csv