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. scanfile ''?'''-copyfile''' copyFileId?'' ''contexthandle'' ''fileId'' Scan the file specified by fileId, starting from the current file position. Check all patterns in the scan context specified by contexthandle against it, executing the match commands corresponding to patterns matched. If the optional '''-copyfile''' argument is specified, the next argument is a file ID (see [open]) to which all lines not matched by any pattern (excluding the default pattern) are to be written. If the copy file is specified with this flag, instead of using the scancontext copyfile command, the file is disassociated from the scan context at the end of the scan. This command does not work on files containing binary data (bytes of zero). ---- Hopefully someone will add in some examples here. In particular, an example that demonstrates how to change file lines based on regular expression hits would be appreciated. ---- See also [scancontext] and [scanmatch]. ---- [Category Command], a part of [TclX]