Thanks again Scott: The problem was with the sample text file. I think that some unfortunate CR/LF line-ending combination had caused trouble. Whereas with a different sample text file, the grep operations worked fine! -- www.netspeed.com.au/bryan/