I am working on a project and coding in Python 3.1 where I need to find a string in a file.
I have already considered reading the file to a string and then using rfind() on it, but that does not seem to be efficient, seeing as how I expect my file to be large.
I am considering using a for loop to read each line, but I'm not sure how efficient that is either.
Any better alternatives out there?
P.S. I need to find the last instance of the sub-string. So a bigger file will almost kill my previous method.