How to compare 1D array with 2D array?

there are 3 csv files, one main file and two sub files, we have to fetch similar data by comparing 1st sub file with main file and 2nd sub file with main file.