Created
April 23, 2015 11:50
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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