22.11.7.4 Read CSV File

Reads data in cell units from a CSV file (constructed from a cell image delimited with ","), and writes it to word addresses.

_CF_read_csv/_SD_read_csv/_USB_read_csv (folder names, file names, save in addresses, start line, the number of lines read)

Example expression:

_CF_read_csv ("\CSV", "SAMPLE.CSV", [w:[#INTERNAL]LS1000], 1, 2)

(When reading two lines of data, starting from the first line of the [ \CSV\SAMPLE.CSV] file in the CF memory card using the "_CF_read_csv ( )" function)

SAMPLE.CSV

Reads two lines of data, starting from the first line of the CSV file. When the first character is a numerical value ("0" to "9", "-", or "+"), the data is stored as a numerical value. When the first character is ["], the data is treated as a character and "00h" is stored at the end of the text string. For example, when storing "DAT01-01" the data size is 8 characters, which is an even number, and a total of five words are used: Four words are used for storing the text string, and one word is used for storing "00h" at the end.

For example, when storing "DAT01-2" the data size is 7 characters, which is an odd number, and a total of 4 words are used to store the text, with "00h" stored at the end.

Error Status

Editor Function Name

LS Area

Error Status

Cause

_CF_read_csv( ) / _SD_read_csv( ) / _USB_read_csv( )

LS9137/
LS9143

0000h

Completed Successfully

0001h

Parameter error

0002h

External Storage Error

No external storage/file open error/file read error

0003h

Write/Read error