Skip to content

Instantly share code, notes, and snippets.

@asw456
Forked from rjurney/create_load_statement.py
Last active August 29, 2015 14:15
Show Gist options
  • Save asw456/6b11a38dd01eacb203e7 to your computer and use it in GitHub Desktop.
Save asw456/6b11a38dd01eacb203e7 to your computer and use it in GitHub Desktop.
import sys, os, re
line = sys.stdin.readline()
columns = line.rstrip("\n").split("|")
load_statement = "full_dump = LOAD 'data/FullDump_clean.csv' AS (\n"
for column in columns:
load_statement += "\t{}:chararray, \n".format(column)
load_statement = load_statement[:-3]
load_statement += "\n);"
print load_statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment