Read Multiple Sensors Data from a text file located in SD Card in Arduino/ESP32
Function file.parseInt(), will skip non numeric characters and then parse the number stopping on non numering character. So you need only call file.parseInt() for every value in row, process the data and then loop to next row.

Y1 = file.parseInt();
S1 = file.parseInt();
S2 = file.parseInt();
S3 = file.parseInt();
S4 = file.parseInt();