I\'m trying to process a file from the protein data bank which is separated by spaces (not \\t). I have a .txt file and I want to extract specific rows and, from that rows,
you can expend the key words as you want. the result is list contained line with key words you can do further process of result to get what you want
with open("your file") as f: keyWords = ['HELIX','SHEET','DBREF'] result = [ line for line in f for key in keyWords if key in line]