-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataReader_functions.py
56 lines (47 loc) · 1.75 KB
/
dataReader_functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
def TR(veri_dosyasi, anahtar_kelime_sayisi, cikti_dosyasi, veri):
i = 0
j = 1
for satir in veri_dosyasi:
yardimci = veri[j]
if(yardimci.lower() in satir.lower()):
if(anahtar_kelime_sayisi == 2):
yardimci = veri[j+1]
if(yardimci.lower() in satir.lower()):
cikti_dosyasi.write(satir)
i += 1
else:
cikti_dosyasi.write(satir)
i += 1
if(i == 0):
print("[-] Aradığınız kriterlerde hiçbir sonuç bulunamadı.")
cikti_dosyasi.close()
os.remove(veri[1] + "_output.txt")
else:
print("[!] " + str(i) + " adet sonuç bulundu.")
print("[+] Sonuçlar '" + veri[1] + "_output.txt' dosyasına yazıldı.")
veri_dosyasi.close()
cikti_dosyasi.close()
def EN(veri_dosyasi, anahtar_kelime_sayisi, cikti_dosyasi, veri):
i = 0
j = 1
for satir in veri_dosyasi:
yardimci = veri[j]
if(yardimci.lower() in satir.lower()):
if(anahtar_kelime_sayisi == 2):
yardimci = veri[j+1]
if(yardimci.lower() in satir.lower()):
cikti_dosyasi.write(satir)
i += 1
else:
cikti_dosyasi.write(satir)
i += 1
if(i == 0):
print("[-] The data you were looking for was not found.")
cikti_dosyasi.close()
os.remove(veri[1] + "_output.txt")
else:
print("[!] " + str(i) + " number of results found.")
print("[+] Result written to '" + veri[1] + "_output.txt' file")
veri_dosyasi.close()
cikti_dosyasi.close()