Files
CyberSecurityClub/Crimson_Defense/Scripts/torrent_file_reconstruction/countTorrentPieces.py
2021-03-29 13:40:25 -05:00

23 lines
327 B
Python

# Stephen
# used python3
import re
READ = open("pieces.txt", "r")
lines = READ.readlines()
count = 0
for line in lines:
# using regex( findall() )
# to extract words from string
res = re.findall(r'\w+', line)
for word in res:
if(word == "Piece"):
count += 1
print(count)
READ.close()