I have a Python code to perform some operations on a text file. I need to run this code over around 200+ text files that are all stored in the same folder.
I want the code to open one text file at a time, perform the operations and then start over with the next text file.
Can you give me some pointers regarding how I can do this?
My code is like this:
def main():
text_file = open("filename.txt","r")
#operations
text_file.close()
main()