Using an SD card to store a high score or high value into a variable

Hey folks, I've got reading from and writing to my SD card down fine. However, I'm struggling with something pretty simple. I have created a highscore.txt file on my SD card that contains literally one integer. I want to read that integer on the file on the SD card into a variable in my code. I've tried a number of different options and can't seem to make it work. I am a novice, but I think in Python/Pygame the command is as simple as

highscore = int([filename].read())

I've used this command when designing games in pygame, and it works fine.

is there something similarly simple for the arduino IDE?

Thanks.

(deleted)

@ashamim

Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

Thanks for your reply Peter.

Yes, I did check SD library and didn't see anything directly helpful. Did I miss something?

PS NOTE TO MODERATOR: apologies for duplicate post

ashamim:
Hey folks, I've got reading from and writing to my SD card down fine. However, I'm struggling with something pretty simple. I have created a highscore.txt file on my SD card that contains literally one integer. I want to read that integer on the file on the SD card into a variable in my code. I've tried a number of different options and can't seem to make it work. I am a novice, but I think in Python/Pygame the command is as simple as

highscore = int([filename].read())

I've used this command when designing games in pygame, and it works fine.

is there something similarly simple for the arduino IDE?

Thanks.

By definition a "text" file only contains 7 bit ASCII characters. Putting a 16 bit binary value (integer) into a text file will cause unknown failures.

Paul