Well since you have things like "Money Heist,8,4,Y" in the 2nd file, you can't decide what to write until you have read both files into memory.

Some ideas for you to think about.
Code:
typedef struct {
    char name[30];
    int num;
    int status;
    char id;
} db;

#define MAX_DB  50
db database[MAX_DB];
int numDbEntries = 0;
Code:
int findByName(db database[], int dblen, const char *name) {
  for ( int i = 0 ; i < dblen ; i++ ) {
    if ( strcmp(db[i].name,name) == 0 ) return i;
  }
  return -1;
}
Code:
void addRecord(db database[], int dblen, const db *new) {
   int found = findByName(db,*dblen,new->name);
   if ( found == -1 ) {
      database[*dblen] = *new;
      (*dblen)++;
   } else {
      // compare database[found] with new
      // Eg.  if ( database[found].id == 'N' && new->id == 'Y' )
   }
}