You read data from the SD card just like from the serial port - one character at a time. Read and store that data in an array, until you encounter the carriage return. Keep the array NULL terminated, or append a NULL at the end. Then, call atoi() or atol(). Then, reset the array index and read the next set of characters.