How to read a number from a file

How to read the number from the file on the sd card and save it to the variable in arduino?
I need to do the measurement numbering after the sensor is started.
I want to do that in the file on the card will be stored the number of the last measurement, and after running I want to read the data give them to the variable increase by 1 and save

Look at the examples with the SD library. They'll show you how to read something from the card. Saving it to a variable is trivial. If you don't know how to write a simple assignment statement to set the value of a variable then I would suggest going through a basic tutorial on C++.

Are the SD card examples missing from your IDE installation?