Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions Binod_detector.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import os

folders = os.listdir()
# print(folders)

path = os.getcwd()
# print(path)
# pdfs = []
# total = {}
# Binod_in = []

print('#'*35, 'binod detector results', '#'*35)

for folder in folders:
Expand All @@ -17,10 +14,10 @@
names = ''
new_path = path+'\\'+folder
os.chdir(new_path)
# print(os.getcwd())
# os.chdir(path)


files = os.listdir()
# print(file)


binod = [file for file in files if file.split('.')[0].lower()=='binod']
for name in binod:
Expand All @@ -29,7 +26,7 @@
binod_file = len(binod)

for file in files:
if file.endswith('txt'):
if file.endswith('txt') or file.endswith('pdf'):
with open(file, 'r') as f:
if 'binod' in f.read().lower():
Binod_in += file+', '
Expand All @@ -42,8 +39,6 @@



# print(total)
# print(pdf)



Expand All @@ -54,4 +49,4 @@




2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# binod_detector
program to find the trending name "Binod" in files

Run thisis script outside of folder in which binod is hidden. This script will tell you how many files have name "binod" and how many filrs have "binod" name hidden inside them.