Friends I need to search for some strings like 'info stat, waiting, connecting, connection pending' in the source txt file those lines which has the strings need to be extracted and saved to a new file.
import re
import os
import sys
file = open("C:\Users\Administrator\Desktop\logs test\source.txt", 'rU')
script = file.readlines()
file.close()
for line in script:
re.search(r'book.info', script, re.I)
after searching how to get the lines that matches the string to a file. Thanks in advance