OPEN file1 READ contents of file1 into array @words OPEN file2 FOR line in file 2 IF line contains any of @words PRINT "#" + line ELSE PRINT line