Read HEX data from SD card

Hi

I'm new here

So...I'm working on Arduino Eprom programer, to program Eprom I need to read data to be programmed from SD card
On SD card is .txt file with hex vaules to be programmed, values are in long data string with no spaces like this:

"3120005080FA56B5C890" and so on...

If I read data from SD card like "31",it gives value as 2 ascii not as one hex value

My question is, is there a way i can read hex value from SD card, or is it possible to read data from SD card as hex and write it to byte as nibbles?

Or if you want to do it the hard way, do something like this to each pair of characters:

temp = strdata[linepos] - 0x30;
if (temp > 9) temp -= 7;
temp1 = strdata[linepos+1] - 0x30;
if (temp1 > 9) temp1 -= 7;
buf[netAddr] = (temp << 4) + temp1;

On SD card i have HEX data but arduino read it as ASCII not HEX

So if I have value "31" it read hex value of ASCII character "3" and "1" but I need to read it as it is
If on SD card is values "31 FB 5B" and so on I want to read it as HEX value not as ASCII characters

mrwifihifi123:
On SD card i have HEX data but arduino read it as ASCII not HEX

So if I have value "31" it read hex value of ASCII character "3" and "1" but I need to read it as it is
If on SD card is values "31 FB 5B" and so on I want to read it as HEX value not as ASCII characters

This is so confusing. How do you know the value is being read as two ASCII characters? Bet you are printing them and the print is doing the conversion so it can show you human readable characters. Perhaps it's time to reveal the program code you are using.

Paul

Reply #4 here is an SD card hex dump utility.

Use it see what you really have, and copy/paste the output here.

I need to write hex data to SD card and read hex data from SD card

Is it possible?