Read/write bytes or chars from/to file on a SD card

Hi,

I need help. How to read bytes or chars one by one, from a .txt file on a SD card and then put those chars into a variable? Or maybe how to read a couple of chars, or a line? I've tried examples that come with an SD library, but those examples only show how to read an entire file. If this topic exist anywhere on the forum, can anyone give me some direction? Same question goes for writing into file.

Thanks in advance!

but those examples only show how to read an entire file.

They show how to read the entire file [u]one character at a time[/u].

and then put those chars into a variable?

A variable can only hold one character. An array can hold more than one. Storing data in an array is trivial. Storing multiple characters in a variable is pointless.

PaulS: They show how to read the entire file [u]one character at a time[/u]. A variable can only hold one character. An array can hold more than one. Storing data in an array is trivial. Storing multiple characters in a variable is pointless.

Sounds like HomeWork to me!