Skip to content

Instantly share code, notes, and snippets.

@geetanjaligg
Created April 23, 2015 11:50
Show Gist options
  • Save geetanjaligg/4f20dca4e110d8f46690 to your computer and use it in GitHub Desktop.
Save geetanjaligg/4f20dca4e110d8f46690 to your computer and use it in GitHub Desktop.
Read csv and create string using header. I needed this to save in ES using scala.
import csv
l = list(csv.reader(open('header.csv')))
for i in range(len(l[0])):
print 'dataMap = dataMap.updated("' + l[0][i] + '", dataArray('+ str(i) +'))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment