can we compare two files one is having different fields and other is a c fie using shell script? : I am having two files

File1:

    #include<stdio.h>   printf,scanf
    #include<string.h>  strcpy,strcat,strlen
    #include<time.h>   time

  File2.c:

>    int main 
>     {
>         char str1[20] = "BeginnersBook";
>          printf("Length of string str1: %d", strlen(str1));
>          return 0;
>     }


My Question here is, we have to search for the functions of file1(field2) in file2, if exists then we should write the result to different file named as output, 
it should contain only the filename and the appropriate header file should be there like  
File2:headerfile1,headerfile2
It is possible to do it with grep and awk.





