Read String from File

\i S r byte::handle char::endchar

Parameter Type Range Description
byte handle 0 ... 3 unique identifier for opened file
endchar byte ASCII char (0x01 ... 0xFF) ending character to read up to

Reads string data from a previously opened file (same as Read File), but the number of bytes returned is determined by the byte value of endchar.

Note

Response: [ACK] data [ACK]

Example

\iSO\1A/CSV.TXT\0
\iSr\1;

Opens the file "CSV.TXT" in the root folder with handle 1 in append mode and reads data until a ';' character is found.

Response Example

[ACK]1,2,3,4,5;[ACK]

The file contains ascending ASCII values, the file pointer is moved after the last byte read (in this case position 10). In a comma separated text file, sending the same (second) command again would read the next line.

Not supported by: DPC3050, DPC3020, DPC2060, DPC10xx

See also:

MicroSD Card Related Commands
Read File
Tell Position in File
Set Position in File
Get File Status
Write File