diff options
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") |
