There is not much pattern matching to do in this task: only check whether the line just read-in contains at least one comma (assuming that only the first line of each record contains commas) which will signal the "lastname, firstname" line. It is probable better/faster done with
index than with a regex.
As you already have it written in xBase, I will not go into the logic of the program itself.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law