import os
###############################
'''Declaring file paths for the respective malware types'''

paths = ['/root/static_analysis/Malware/Backdoor/','/root/static_analysis/Malware/Trojan/','/root/static_analysis/Malware/TrojanDownloader/','/root/static_analysis/Malware/TrojanDropper/','/root/static_analysis/Malware/Virus/','/root/static_analysis/Malware/Worm/']

##################################

for path in paths:
	files = os.listdir(path)
	for f1 in files:
		templist = []
		cleanString = path + '/' + f1 + '/clean.txt'
		pathString = path + '/' + f1 + '/String.txt'
		stringFile = open(pathString, 'r')
		cleanFile = open(cleanString, 'a')
		lines = stringFile.readlines()
		for line in lines:
			tempFlag = 0
			if len(line) >= 8:
				if not tempFlag:
					cleanFile.write(line)
		cleanFile.close()
		stringFile.close()
					
					


