To everyone who helped me: Thank you for your kind response. You were right - I had not rewound the file, so I was matching an empty line at the end (i.e., signalling that I had successfully made it through the file) and never making any of the other tests. I was able to get the code working -- it has inspired me to become proficient in Python. This was my first script in Python and it was a joy to write. Thanks! -Van