CSV integere number parsing

That's not CSV its SSV!

You need to build a state machine to recognise this. States would be something like "seen separator", "within integer", "in text string", "newline". Each character is read in turn, this character (in combination with the current state) determines what to do next. For instance when "within integer" and you see a digit, you multiply the integer-so-far by ten and add the digit-value of the character. You'll need an array to hold the integers as you accumulate them, a counter for how many integers you've seen this line, a current "integer so far" variable, etc.