I am writing a simple code which is working absolutely fine with one file but I want to do the same process for all files in current working folder. Just like we give * in terminal. For example
ls * // which list all the files and folders in current working directory
What I am trying to do is that I have 100s of files with some of the data I want and lots of junk data. All files are in same format just values I want are different (for your reference these files are browser request/response body saved using BurpSuite (intruder)). So all files are almost same but only some values are different according to the User Account which I want.
My code:
start = "#patient_name').val('"
end = "');$('#father_name"
filename = input("Enter file name: ")
myfile = open(filename, "rt")
text = myfile.read()
print(text[text.find(start)+len(start):text.rfind(end)])
My output:
