OK, I found your problem. You are using scanf to get the string to search for, with the following code:
printf("enter the name you want to search \n");
scanf("%s",j);
result = Search_in_File("name.csv", j);
BUT, scanf treats white space as a token separator, so if you enter "mc Larenc", it will only extract the "mc" part as the value to be stored in j. So you are counting each string that contains the string "mc". Using
strcmp
might have helped you find the mistake sooner.