This is a pretty common requirement, search the board for some examples of how it's been done in the past.

The easiest way is:
  • Read entire FileA into an array.
  • Read FileB, search array for each record.
  • If the record is present, write to FileC


This works much better if the files are sorted.