Arduino reading commands from sd to control an I2c-device

Hi , I have an Arduino Mega2560 with an SD-Module an with a selfprogrammed GUI (VB) i send to the Arduino via Serial, some commands , which I store on the sd in a csv.file. My target is, to control with these commands an i2c / SPI-device with the arduino ,without a direct connection to the pc. And for the I2c(TWI) I use the Wire-library.

I found this topic and its very helpful, becuase i have the same problem:,45903.0.html, but i have some questions.

1) I need the commands in HEX or Byte -format its possible to retrieve the commands form the csv and convert these in HEX? 2. I save 3 commands per line in the csv in this format: 58; 3A; AB. The first ist the slave address, the second number ist the register, and the last one is the Data - Byte. Know How i can retrieve this from the csv file so that i can send this numbers in Hex and as Separated VAlue?

I hope my description is clear .

The SD library has only the read() function to read data from a file

I suggest to read a line (ended by '.' or '\r' or '\n' or end of file) in a buffer and use sscanf to convert the line into variables.

Sorry can someone give me a code example please :(.