Commit b6b2f102 by Ethan Mertz

fixed some sturf

parent f411ae04
Showing with 10 additions and 7 deletions
......@@ -18,12 +18,15 @@ def get_unique_vars(filename):
def main():
count = 0
for filename in glob.glob("pydata/pyfile*.txt"):
print("working on " + filename)
s = get_unique_vars(filename)
with open("pyvariables/varfile" + str(count) + ".txt", "w") as f:
for var in s:
f.write(var + "\n")
count += 1
if count == 50000:
return
else:
print("working on " + filename)
s = get_unique_vars(filename)
with open("pyvariables/varfile" + str(count) + ".txt", "w") as f:
for var in s:
f.write(var + "\n")
count += 1
if __name__ == '__main__':
......
......@@ -17,7 +17,7 @@ class MRWordFreqCount(MRJob):
def mapper(self, _, line):
file1, file2, total = line.split(",")
file2name = "pyfile" + file2 + ".txt"
for file_number in {file1, file2}:
for file_number in {file1, file2}: #If file1 == file2
filename = "pyfile" + file_number + ".txt"
file_text = filename.read()
for i in range(int(file1) + 1, int(total)):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment