in reply to How to read a text file, extract a records that contains a string, export the result into a temporary file
while (<STDIN>) { /TWO/ && print STDOUT $_; } [download]
By the way,you really should go to your teacher and ask for a tutor.