Commit d74f15ae authored by root's avatar root

query in files of a directory

parent 417c491c
import sys
import os
query=sys.argv[1]
filelist = os.listdir("../data")
#print filelist
for file in filelist:
fr = os.path.join("../data",file)
# print fr
f = open(fr)
contents = f.read()
l = contents.split(" ")
if query in l:
print fr
f.close()
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 to comment