Created
December 6, 2019 00:18
-
-
Save philcali/e62ec9dc36982753f1e0b01e29fc5420 to your computer and use it in GitHub Desktop.
Simple script to output multiple files from Google form submissions.
This file contains 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 | |
import sys | |
with open(sys.argv[1]) as csvfile: | |
reader = csv.reader(csvfile) | |
rows = list(reader) | |
headers = rows[0][2:] | |
answers = rows[1:] | |
for answer in answers: | |
content = answer[2:] | |
name = content[0] | |
with open(name + ".txt", "w") as f: | |
for i in range(0, len(headers)): | |
f.write(headers[i]) | |
f.write("\n") | |
f.write(content[i]) | |
f.write("\n\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment