From 4eaf1b355c5eadfeddec0beb6daa85e843640c86 Mon Sep 17 00:00:00 2001 From: Aadarsh Chaurasia <72143159+AadarshChaurasia@users.noreply.github.com> Date: Fri, 2 Oct 2020 12:25:03 +0530 Subject: [PATCH 1/3] Update Binod_detector.py --- Binod_detector.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Binod_detector.py b/Binod_detector.py index ca7340d..0aa67d0 100644 --- a/Binod_detector.py +++ b/Binod_detector.py @@ -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: @@ -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: @@ -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+', ' @@ -42,8 +39,6 @@ -# print(total) -# print(pdf) @@ -54,4 +49,4 @@ - \ No newline at end of file + From 4bef01fa6314ecc519b1b07c4928535455cace1e Mon Sep 17 00:00:00 2001 From: Aadarsh Chaurasia <72143159+AadarshChaurasia@users.noreply.github.com> Date: Fri, 2 Oct 2020 12:27:09 +0530 Subject: [PATCH 2/3] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a80aa03..b378f4d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # binod_detector program to find the trending name "Binod" in files + +run this file 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. From bfe63e06bff018d66a9d5b9d9b6814beeb68b12f Mon Sep 17 00:00:00 2001 From: Aadarsh Chaurasia <72143159+AadarshChaurasia@users.noreply.github.com> Date: Fri, 2 Oct 2020 12:27:55 +0530 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b378f4d..7c3e46e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # binod_detector program to find the trending name "Binod" in files -run this file 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. +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.