diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2014-10-24 12:16:51 -0400 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2014-10-24 12:16:51 -0400 |
| commit | ece1d828d53d6123fcecb5ea8bf9b126d1728ccc (patch) | |
| tree | b669382d0e5f1234556d1aeb7fa919891510b24d /facebook_scraping/mturk.py | |
| parent | 7426d8ff0e7969eb1a86bdb5bec8a0c971309e2b (diff) | |
| download | fast-seeding-ece1d828d53d6123fcecb5ea8bf9b126d1728ccc.tar.gz | |
Add code
Diffstat (limited to 'facebook_scraping/mturk.py')
| -rw-r--r-- | facebook_scraping/mturk.py | 16 |
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") |
