in reply to Using grep to pick out lines in a text file
I think you'd find Beginning Perl useful. It's freely available online.