# Automated way to clean lots of .txt files?

I have hundreds of .txt files. I need to get into each one of them and remove certain paragraphs that start with specific words but as a whole, are not exactly the same every time. Is there an automatic way that can help me clean these parts out? If yes, what is it? If not, is it easy/quick to create my own AI tool for this job? Assuming that I need to get this done very soon, does it take a lot of time to learn how to create an AI tool to get the job done for me?

• What it means "remove certain paragraphs that have specific start words but they are not exactly the same each time" ? – pasaba por aqui Mar 10 '18 at 14:48
• I think some regex logic and use of sed command can help you out. – Ugnes Mar 11 '18 at 3:18
• @pasabaporaqui I modified that part..it means paragraphs starting with same sentences but changing off some where in the middle. – DuttaA Mar 12 '18 at 12:17
• Yes, but never mind. thanks ! – user105139 Mar 12 '18 at 18:45

I think theres definitely a way to do what you want, but I'm not sure AI will work magic for you.

As far as I can tell there's a few things you need.

1: A program that finds strings and removes paragraphs with the offending strings indside them.
For this, some python code:

path = '/some/path/to/file'
for filename in os.listdir(path):
with open(filename) as f: