Fi̇nger pri̇nt module help

Hi guys.I am trying to make a device for attendance for students it is a project for school.I have two txt file one of them contains student names other contains which students scanned his finger.Now If a student scan his finger twice,arduino write his name to attendance file twice.How can i prevent this.Here is my code.

#include <Adafruit_Fingerprint.h>
#include <SPI.h>
#include <SdFat.h>
#include <LiquidCrystal.h>

SoftwareSerial mySerial(12, 13);

#define DIRECTORY_ENTRY_LENGTH 30
#define FILE_LINE_LENGTH 30
File myFile;
SdFat SD;
int count=0;

const int rs = 8, en = 7, d4 = 6, d5 = 5, d6 = 4, d7 = 3;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

void setup()
{
lcd.begin(16, 2);
lcd.print("waiting finger");
SD.begin(9);
finger.begin(57600);
delay(5);
if (finger.verifyPassword()) {

} else {

while (1) { delay(1); }

}
}

void loop()
{
getFingerprintID();
delay(50);
}

uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:

  break;
case FINGERPRINT_NOFINGER:
  
  return p;
case FINGERPRINT_PACKETRECIEVEERR:
  
  return p;
case FINGERPRINT_IMAGEFAIL:
  
  return p;
default:
  
  return p;

}

p = finger.image2Tz();
switch (p) {
case FINGERPRINT_OK:

  break;
case FINGERPRINT_IMAGEMESS:
  
  return p;
case FINGERPRINT_PACKETRECIEVEERR:
  
  return p;
case FINGERPRINT_FEATUREFAIL:
  
  return p;
case FINGERPRINT_INVALIDIMAGE:
  
  return p;
default:
  
  return p;

}

p = finger.fingerSearch();
if (p == FINGERPRINT_OK) {

} else if (p == FINGERPRINT_PACKETRECIEVEERR) {

return p;

} else if (p == FINGERPRINT_NOTFOUND) {

return p;

} else {

return p;

}

readFile("/","NAMES.txt");
return finger.fingerID;
}

int getFingerprintIDez() {
uint8_t p = finger.getImage();
if (p != FINGERPRINT_OK) return -1;

p = finger.image2Tz();
if (p != FINGERPRINT_OK) return -1;

p = finger.fingerFastSearch();
if (p != FINGERPRINT_OK) return -1;

return finger.fingerID;
}
void readFile(char* Path, char* FileName){
Serial.print(F(" -- Reading entries from file = "));
Serial.print(Path);
Serial.println(FileName);
SdFile directory;
SdFile file;

if(SD.chdir(Path)){
if(file.open(FileName)){

char Line[FILE_LINE_LENGTH];
memset(Line,0,sizeof(Line));
char Char[2];
memset(Char,0,sizeof(Char));

while (file.available()) {
Char[0] = file.read();
if(Char[0]=='\n'){
count=count+1;
if(count==finger.fingerID){
myFile = SD.open("Attendance.txt", FILE_WRITE);
myFile.println(Line);
myFile.close();
lcd.clear();
lcd.print(Line);
delay(2000);
lcd.clear();
lcd.print("waiting finger");
count=0;
break;
}
memset(Line,0,sizeof(Line));
}
else if(Char[0]>=32)
strcat(Line,Char);
}
file.close();
}
else

directory.close();
}

}

The easier you make it to read and copy your code the more likely it is that you will get help

Please follow the advice given in the link below when posting code , use code tags and post the code here

If you get errors when compiling please copy them from the IDE using the "Copy error messages" button and paste the clipboard here in code tags

If PersonScanIn search array for name, not exist, if new scan in add to list put into file, name in scanned in list already, ignore.