summaryrefslogtreecommitdiffstats
path: root/facebook_scraping/mturk.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2014-10-24 12:16:51 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2014-10-24 12:16:51 -0400
commitece1d828d53d6123fcecb5ea8bf9b126d1728ccc (patch)
treeb669382d0e5f1234556d1aeb7fa919891510b24d /facebook_scraping/mturk.py
parent7426d8ff0e7969eb1a86bdb5bec8a0c971309e2b (diff)
downloadfast-seeding-ece1d828d53d6123fcecb5ea8bf9b126d1728ccc.tar.gz
Add code
Diffstat (limited to 'facebook_scraping/mturk.py')
-rw-r--r--facebook_scraping/mturk.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/facebook_scraping/mturk.py b/facebook_scraping/mturk.py
new file mode 100644
index 0000000..f6322da
--- /dev/null
+++ b/facebook_scraping/mturk.py
@@ -0,0 +1,16 @@
+import csv
+import os.path as op
+from glob import glob
+
+for fname in glob("*.csv"):
+ with open(fname) as f:
+ reader = csv.reader(f)
+ oname, _ = op.splitext(fname)
+ oname = oname + ".txt"
+ with open(oname, "w") as of:
+ for i, row in enumerate(reader):
+ if i == 0:
+ continue
+ if row[-1] == "":
+ row = row[:-1]
+ of.write("\t".join(row) + "\n")