scanfile is one of a set of commands designed to assist the user in looking through an open file for matches against a regular expression.
scanfile actually is the 'loop' that causes the evaluations to take place.
Hopefully someone will add in some examples here.
See also scancontext and scanmatch.
Category Command, a part of TclX