Writing txt File to Integer

I have a txt file with a single integer in it (eg; "10"). I need to read it and display it on the LCD. I can read it into the serial display, and write files onto the text file, but I can not make my integer "count" equal to the value in the txt file.

dataCount = SD.open("count.txt");

  if (dataCount) {
   
    while (dataCount.available()) {

    
//*********ALL COMBINATIONS I HAVE TRIED*********


dataCount.read();
Serial.write(dataCount.read());
int count = Serial.read();
write(dataCount.read() 
int count = Serial.write(dataCount.read());  
count == (dataCount.read());  
  }}
    //dataCount.read() == count;
    //int count = (dataCount.read());
    //close the file:
    dataCount.close();
   Serial.println (count);

I get "count = -1" which is the return if the read value is not available.

To clarify; txt file "dataCount" holds a single value in txt format that I need to convert to a byte to set as an integer in my program.

Thanks guys!

while !EOF
lcd.write(file.read)

DangerDoOperate:
I have a txt file with a single integer in it (eg; "10").

I reckon you problem starts right there.

Your text file does NOT have a single integer. It has two characters '1' and '0'

That's going to require two read()s. Something like

char myNumber[5]; 
int myInteger;

myNumber[0] = file.read;
myNumber[1] = file.read;
myNumber[2] = 0;  // this terminator is essential

myInteger = atoi(myNumber);

And that could be written in a much more elegant way - but it should get you started.

...R