while I read next line from file if line contains extension listed in my extension list write line to output file add one to lines copied else write line to error report add one to error count end if end while