User:Manetta/scripts/python-find-write

From XPUB & Lens-Based wiki
import itertools

# Open text file for reading
with open('WRITE.txt', 'w') as txt:

	f = open('INPUT.txt', 'r')
	for line in f:
		if "SEARCHTERM" in line: 
			selection = line
			print selection
			txt.write(selection), "\n"
	f.close()