Python is a great scripting language. www.python.org
Al Sweigart wrote great Python books;
Automate the boring tasks with Python
Read his books online or buy his books. I have all of his books!
Regular expressions allow you to specify patterns of text to search for.
www.regular-expressions.info is a good resource.